Hello,

According the the thread below :
- http://lists.apple.com/archives/webobjects-dev/2008/Aug/msg00088.html
and the slide :
- http://fr.slideshare.net/wocommunity/background-tasks

Only when using new 
EOEditingContext(ERXTaskObjectStoreCoordinatorPool.objectStoreCoordinator()) 
instead of new EOEditingContext(new EOObjectStoreCoordinator()) will propagate 
changes.
("Create a new ObjectStoreCoordinator (use Wonder OSC synchronization if you 
want changes to propogate)")

So I develop a new thread (for sending mass emails without slowing down all the 
users as currently)

I used :

a)

I use new 
EOEditingContext(ERXTaskObjectStoreCoordinatorPool.objectStoreCoordinator()) 
for the thread


b)

I add the code below each time I want changes to be propagated.

EOEditingContext _editingContextInDefaultEOObjectStore = new EOEditingContext();
_editingContextInDefaultEOObjectStore.invalidateObjectsWithGlobalIDs(new 
NSArray(new Object[]{ 
_editingContextInThreadObjectStoreCoordinator().globalIDForObject(_localCampaign)
 }));
_editingContextInDefaultEOObjectStore.invalidateObjectsWithGlobalIDs(new 
NSArray(new Object[]{ 
_editingContextInThreadObjectStoreCoordinator().globalIDForObject(_localCampaign._campagneTask())
 }));

try {
_editingContextInDefaultEOObjectStore.saveChanges();
}
catch (Exception e) {
e.printStackTrace();

_editingContextInDefaultEOObjectStore.revert();
}

My task works well, changes are saved in the database…

…but changes are only propagate to the users (in the default EOObjectStore) 
when the do saveChanges() to their editingContext();

I tried using 
ERXEC.newEditingContext(ERXTaskObjectStoreCoordinatorPool.objectStoreCoordinator());
 without any success.

Any idea where am I wrong ?

Jérémy
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to