Re: Yes, even one more concurrency question - relationship "freshness"
Re: Yes, even one more concurrency question - relationship "freshness"
- Subject: Re: Yes, even one more concurrency question - relationship "freshness"
- From: Chuck Hill <email@hidden>
- Date: Tue, 14 Aug 2007 09:40:05 -0700
On Aug 14, 2007, at 9:25 AM, Miguel Arroz wrote:
Hi!
On 2007/08/14, at 17:03, Chuck Hill wrote:
Hi Miguel,
You do have all the fun. Must be nice in Alentejo this time of
year...
Friday. Friday I go there. Right before the border with Spain,
Serpa is where I'll go. Good food. Sun. Pool. The bad news is... I
come back Sunday.
:-)
I can't see how EOF is finding this object. Can you post the
start of the stack trace when this happens?
Here it goes (tweaked some package names for trade-secret
purposes!). I used the debugger to peek inside all the EC
variables, and I found no reference to the object.
java.lang.IllegalStateException: Cannot obtain globalId for an
object which is not registered in any editingContext, object:
{values = {filterNumber = 1; status = "waiting"; survey = "null";
lastRepondentToProcess = "null"; issueDate = 2007-08-13 22:45:15
Etc/GMT; }; this =
"<com.DELETED.model.entity.FilterProcessingRequest af8109 [Gid Not
Found]>"; }, databaseContext:
com.webobjects.eoaccess.EODatabaseContext@81db25, object's
editingContext: null, databaseContext's active editingContext:
com.webobjects.eocontrol.EOEditingContext@356f42
at com.webobjects.eoaccess.EODatabaseContext._globalIDForObject
(EODatabaseContext.java:4847)
at
com.webobjects.eoaccess.EODatabaseContext.databaseOperationForObject
(EODatabaseContext.java:4964)
at com.webobjects.eoaccess.EODatabaseContext.recordUpdateForObject
(EODatabaseContext.java:6247)
See, it is trying to create an UPDATE statement for this object.
Something has trashed the EC state.
Maybe try adding
ec.undoManager().removeAllActions(); before the call to saveChanges
(), or try getting rid of the undo manager before making any changes:
ec.setUndoManager(null);
If you are not reverting, you don't need this.
Hmmm, I have some recollection than an exception thrown during the
delete processing of saveChanges() trashing EC state. IIRC, it was
undo manager related. I have an EC subclass that calls ec.undoManager
().removeAllActions(); after each successful save to avoid this
problem. So this might be close to what is happening to you.
at
com.webobjects.eoaccess.EODatabaseContext.nullifyAttributesInRelations
hipSourceObjectDestinationObject(EODatabaseContext.java:5144)
at
com.webobjects.eoaccess.EODatabaseContext.nullifyAttributesInRelations
hipSourceObjectDestinationObjects(EODatabaseContext.java:5165)
at
com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContex
t(EODatabaseContext.java:6133)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditing
Context(EOObjectStoreCoordinator.java:412)
at com.webobjects.eocontrol.EOEditingContext.saveChanges
(EOEditingContext.java:3226)
at <my method>
...
I think there are a lot of applications our there with theoretical
problems. I am not sure that people find this to be a problem in
practice or, if they do, that they realize what happened. For
many of them concurrency is not a problem, users never edit
objects that other users can access. For may others, a "last in
wins" approach is just fine. It is definitely one of the
unpolished areas of EOF.
I know that some problems that I'm fixing won't simply never
occur, and others may occur a few times in my app lifetime. But
still, it makes me nervous. I don't mind if a user in a thousand
users sees an error page in a thousand good pages. That doesn't
bother me. What bothers me is corrupting the data in the DB. When
dealing with tens of thousands of users, it's not something that
you can just go the backup and recover the erased file... the fact
that the data CANNOT be corrupted, period, scares me a little.
That's why I try to deal with all the possibilities.
It is always better to handle these things.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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
References: | |
| >Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Chuck Hill <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Chuck Hill <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Chuck Hill <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Chuck Hill <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Chuck Hill <email@hidden>) |
| >Re: Yes, even one more concurrency question - relationship "freshness" (From: Miguel Arroz <email@hidden>) |