multiple EOF stacks and EOSharedEditingContext
David Teran <[email protected]> Thu, 29 May 2003 10:20:43 +0200
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Hi,
with 5.2.1 its finally again possible to use multiple, concurrent
operating EOF stacks. Now i wonder if editingContexts with different
EOObjectStoreCoordinator's should use different
EOSharedEditingContext's or not. I would think that each EOF stack
needs its own EOSharedEditingContext. The api-doc says:
public EOSharedEditingContext(EOObjectStore o)
-- do not use this method
I wonder why i should not use it? Would it be OK to do something like
this:
synchronized (myLock) {
EOObjectStoreCoordinator[10] oscs; //assume this exists
NSMutableDictionary sharedEditingContextForObjectStoreCoordinator =
new NSMutableDictionary();
for (int i = 0; i < 10; i++) {
EOEditingContext.setDefaultParentObjectStore(oscs[i]);
sharedEditingContextForObjectStoreCoordinator.setObjectForKey(new
EOSharedEditingContext(), oscs[i]);
}
}
to avoid the constructor mentioned above and to use the one that is
supported according the docs?
Or is it OK to just use -one- EOSharedEditingContext for multiple EOF
stacks?
cheers, David