Re: Quick ERXEnterpriseObject newly inserted Question --
Re: Quick ERXEnterpriseObject newly inserted Question --
- Subject: Re: Quick ERXEnterpriseObject newly inserted Question --
- From: Anjo Krank <email@hidden>
- Date: Tue, 14 Dec 2010 22:34:56 +0100
There is a reason why stuff in BT is done as it is.
I.e. there is a People.class.setCurrentUser(People user) and People.class.currentUser(EOEditingContext ec). Basically it puts all the thread storage code (including the key) in People, which is, like, good style?
Also, ERXThreadStorage already handles EOs and faulting.
Cheers, Anjo
Am 14.12.2010 um 21:57 schrieb David Holt:
> public static Person currentUser(EOEditingContext ec) {
> Person currentUser = currentUser();
> if (currentUser != null && currentUser.editingContext() != ec) {
> EOEditingContext currentUserEc = currentUser.editingContext();
> currentUserEc.lock();
> try {
> Person localUser = (Person) ERXEOControlUtilities
> .localInstanceOfObject(ec, currentUser);
> currentUser = localUser;
> } finally {
> currentUserEc.unlock();
> }
> }
> return currentUser;
> }
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden