On 04/11/2008, at 4:33 PM, Lachlan Deck wrote:
On 04/11/2008, at 9:12 AM, Chuck Hill wrote:
On Nov 2, 2008, at 10:30 PM, Paul Hoadley wrote:
On 03/11/2008, at 3:59 PM, Chuck Hill wrote:
[2008-11-3 16:53:8 CST] <WorkerThread2>
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
java.lang.IllegalStateException: rowDiffsForAttributes: snapshot
in com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {};
_entity = "AMPerson"; _newRow = {lastName = "Hoadley"; lastLogin =
2008-11-03 06:23:08 Etc/GMT; id = 1; username = "super"; dob =
1973-06-07 14:30:00 Etc/GMT; password =
"hFG6ihTXl1PTTLM7UbpGtLAl64E="; firstName = "Paul"; lastPWChange =
2007-11-12 13:30:00 Etc/GMT; }; _object = "PERSON: Paul Hoadley";
_globalID = _EOIntegralKeyGlobalID[AMPerson (java.lang.Integer)1];
_databaseOperator = "EODatabaseUpdateOperator"; } does not contain
value for attribute named contactDetailsID with snapshot key:
contactDetailsID
So back up a bit in that error message:
_dbSnapshot = {};
That it is specifically complaining about contactDetailsID is is
red herring. The snapshot does not have values for any of the
attibutes, it is empty / missing.
If you're mapping the parent entity to a table in the db - you've
got VI rather than HI. I've never heard anyone mention before this
thread that for HI your parent entity needs to map to an external
table for pk generation. Again, if your parent entity has an
external table you're using VI.
Maybe I need to start again from scratch.
Several things can cause this. Some examples,.
http://lists.apple.com/archives/webobjects-dev/2008/Apr/msg00458.html
Google for "_dbSnapshot = {};" for more.
IIRC, a bug with VI can also cause this. Lachlan may recall.
For VI your _changedValues will be {} for the parent entity - which
will give you a lock operation (with default EOF EODatabaseContext
anyway) - if the attributes for the parent entity have not been
changed prior to saveChanges.
Despite your comment above, I didn't think I was using VI. The child
entity's table contains all the columns of the parent. So certainly
no attributes for the parent have been changed, but only because they
all have their own copies in the child. Am I confusing EOF by having
a table for the parent entity?
This (pulled from the thread you've linked to is the common cause:
This is mostly commonly caused by not locking / improperly locking
EOEditingContext, EODatabaseContext, and probably a few of their
friends like EOObjectStoreCoordinator.
Or EOF got into a weird state. Is this happening on a relationship
e.g., from a child entity to another child entity?
No, its happening on an update to a timestamp column on the child.
Worse, it's only happening the second time the app tries an update on
that column. It's the lastLogin attribute. I can log in, and the
column gets updated:
[2008-11-3 20:52:46 CST] <WorkerThread0> === Begin Internal Transaction
[2008-11-3 20:52:46 CST] <WorkerThread0> evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "UPDATE amperson SET
last_login = ?::timestamp WHERE id = ?::int4" withBindings:
1:2008-11-03 20:52:46.912(lastLogin), 2:3(id)>
[2008-11-3 20:52:46 CST] <WorkerThread0> === Commit Internal
Transaction
Then if I log out, and back in:
[2008-11-3 20:53:3 CST] <WorkerThread1> === Begin Internal Transaction
[2008-11-3 20:53:3 CST] <WorkerThread1> evaluateExpression:
<com.webobjects.jdbcadaptor.PostgresqlExpression: "UPDATE amperson SET
last_login = ?::timestamp WHERE id = ?::int4" withBindings:
1:2008-11-03 20:53:03.434(lastLogin), 2:3(id)>
[2008-11-3 20:53:3 CST] <WorkerThread1> === Rollback Internal
Transaction
[2008-11-3 20:53:3 CST] <WorkerThread1>
<com.webobjects.appserver._private.WOComponentRequestHandler>:
Exception occurred while handling request:
java.lang.IllegalStateException: rowDiffsForAttributes: snapshot in
com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {}; _entity
= "AMPerson"; _newRow = {lastName = "Turner"; lastLogin = 2008-11-03
10:23:03 Etc/GMT; id = 3; username = "admin"; dob = 1973-06-07
14:30:00 Etc/GMT; password = "0DPiKuNIrrVmD8IUCuw1hQxNqZc="; firstName
= "Turnkey"; lastPWChange = 2007-11-12 13:30:00 Etc/GMT; }; _object =
"PERSON: Turnkey Turner"; _globalID = _EOIntegralKeyGlobalID[AMPerson
(java.lang.Integer)3]; _databaseOperator =
"EODatabaseUpdateOperator"; } does not contain value for attribute
named contactDetailsID with snapshot key: contactDetailsID
Application.handleException: Handling an Exception:
java.lang.IllegalStateException: rowDiffsForAttributes: snapshot in
com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {}; _entity
= "AMPerson"; _newRow = {lastName = "Turner"; lastLogin = 2008-11-03
10:23:03 Etc/GMT; id = 3; username = "admin"; dob = 1973-06-07
14:30:00 Etc/GMT; password = "0DPiKuNIrrVmD8IUCuw1hQxNqZc="; firstName
= "Turnkey"; lastPWChange = 2007-11-12 13:30:00 Etc/GMT; }; _object =
"PERSON: Turnkey Turner"; _globalID = _EOIntegralKeyGlobalID[AMPerson
(java.lang.Integer)3]; _databaseOperator =
"EODatabaseUpdateOperator"; } does not contain value for attribute
named contactDetailsID with snapshot key: contactDetailsID
I'm stumped. I'll start looking at the links suggested by Chuck.
--
Paul.
w http://logicsquad.net/
h http://paul.hoadley.name/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]