Re: rowDiffsForAttributes _dbSnapshot and _newRow missing attributes
Re: rowDiffsForAttributes _dbSnapshot and _newRow missing attributes
- Subject: Re: rowDiffsForAttributes _dbSnapshot and _newRow missing attributes
- From: David Avendasora <email@hidden>
- Date: Sat, 12 Apr 2008 05:27:34 -0400
First of all, I'm not sure why a lot of my emails are getting
seriously delayed. I sent this immediately after my original message
(minutes after).
On Apr 11, 2008, at 7:30 PM, Chuck Hill wrote:
On Apr 11, 2008, at 10:42 AM, David Avendasora wrote:
Oh, and I get this error other Entities, referencing simple
(Integer) class attributes too. I don't know what changed that is
causing this!
Happy Friday Dave!
I dug through some old messages. All the bad memories came back.
This is mostly commonly caused by not locking / improperly locking
EOEditingContext, EODatabaseContext, and probably a few of their
friends like EOObjectStoreCoordinator.
The problem is that being a D2JC application, the client-side EOF
classes are doing all that. I don't actually do any of it and I'm
really not sure how I would. The only client-side classes my
application has are the Entity classes. WO generates the UI Swing
classes on-the-fly using the rules engine and the user.d2wmodel and
the .eomodeld file.
I'm not saying you aren't right, just that I'm not controlling what
happens here, WO is, and it appears that it's somehow doing it wrong
when heavy RMI is involved.
Now, when I switch to JBND and am writing my own UI classes, then I'm
going to have to get intimate with the whole EOEditingContext concept.
Yipee.
I did also manage to cause this in one other situation:
As it turns out, I am an idiot. I was running and rerunning a set
of functional tests. I was not stopping the app, but between each
run I would run a script to reset the data. Sigh. And part of the
script, which I have been watching scroll before my eyes and not
reading, was reseting the primary key generators in the database.
Which led EOF to generate primary keys for new objects that matched
those of objects already in the snapshots. Chaos ensued.
Considering what I was doing, I am amazed at the very small bad
effect that it had.
The offending bit of script moved, everything works as expected.
Now, without a doubt, it is time for beer.
Now, this I've done myself. Almost exactly the same, only I had a SQL
job running in the background that was messing with the PKs. Took me
_hours_ of troubleshooting my java to figure out that my application
was fine, I was being an idiot in an entirely new way.
While it's not a perfect solution, I now run DELETE * FROM EO_PK_TABLE
at the end of every external SQL Script that could possibly insert a
record.
Chuck
On Apr 11, 2008, at 1:37 PM, David Avendasora wrote:
Hi all,
I'm using WO 5.3 and only ERExtensions from Wonder.
I've just started getting an odd error now when I try to save my
EditingContext that I've never gotten before. The full stack trace
is below, but here's the basics, formatted for easier reading:
<WorkerThread0> Server exception:
rowDiffsForAttributes: snapshot in
com.webobjects.eoaccess.EODatabaseOperation {
_dbSnapshot = {};
_entity = "BillOfMaterial";
_newRow = {
isActive = false;
mustBeBalanced = false;
partId = <com.webobjects.foundation.NSKeyValueCoding$Null>;
routingDescription = "Preform Homestyle 240/1oz Chocolate Chip,
MMA BOM";
isDefault = false;
productionSequence = 0.000000;
partQuantity = 1.000000; };
_object = "Preform Homestyle 240/1oz Chocolate Chip, MMA BOM";
_globalID = _EOIntegralKeyGlobalID[BillOfMaterial
(java.lang.Long)1138];
_databaseOperator = "EODatabaseUpdateOperator";
} does not contain value for attribute named billOfMaterialTypeId
with snapshot key: billOfMaterialTypeId
I see several problems with this:
1) _dbSnapshot is completely empty! This object is in the DB, so
it should have a dbSnapshot, right?
2) The only change to the EO this is referring to _should be_ that
the partId is being set to null by this object being removed from
the Part->> BillOfMaterial relationship. Part "owns"
BillOfMaterial, so this object should be in the process of being
deleted.
3) The list of attributes in the _newRow dictionary isn't
complete. It really doesn't contain the billOfMaterialTypeId
attribute or several others. Why?!
billOfMaterialTypeId is a non-class attribute in the Model that is
a FK for a toOne relationship. According to the API for
EODatabaseOperation newRow, and I'm assuming _newRow, are
supposed to contain all non-derived attributes, including non-
class ones like PKs and FKs.
Any ideas as to what is going on?!
[2008-04-11 12:45:48 EDT] <WorkerThread0> Server exception:
rowDiffsForAttributes: snapshot in
com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {};
_entity = "BillOfMaterial"; _newRow = {isActive = false;
mustBeBalanced = false; partId =
<com.webobjects.foundation.NSKeyValueCoding$Null>;
routingDescription = "Preform Homestyle 240/1oz Chocolate Chip,
MMA BOM"; isDefault = false; productionSequence = 0.000000;
partQuantity = 1.000000; }; _object = "Preform Homestyle 240/1oz
Chocolate Chip, MMA BOM"; _globalID =
_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1138];
_databaseOperator = "EODatabaseUpdateOperator"; } does not contain
value for attribute named billOfMaterialTypeId with snapshot key:
billOfMaterialTypeId
[2008-04-11 12:45:48 EDT] <WorkerThread0>
java.lang.IllegalStateException: rowDiffsForAttributes: snapshot
in com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {};
_entity = "BillOfMaterial"; _newRow = {isActive = false;
mustBeBalanced = false; partId =
<com.webobjects.foundation.NSKeyValueCoding$Null>;
routingDescription = "Preform Homestyle 240/1oz Chocolate Chip,
MMA BOM"; isDefault = false; productionSequence = 0.000000;
partQuantity = 1.000000; }; _object = "Preform Homestyle 240/1oz
Chocolate Chip, MMA BOM"; _globalID =
_EOIntegralKeyGlobalID[BillOfMaterial (java.lang.Long)1138];
_databaseOperator = "EODatabaseUpdateOperator"; } does not contain
value for attribute named billOfMaterialTypeId with snapshot key:
billOfMaterialTypeId
at
com
.webobjects
.eoaccess
.EODatabaseOperation
.rowDiffsForAttributes(EODatabaseOperation.java:338)
at
com
.webobjects
.eoaccess
.EODatabaseContext
.createAdaptorOperationsForDatabaseOperationAttributes
(EODatabaseContext.java:5373)
at
com
.webobjects
.eoaccess
.EODatabaseContext
.createAdaptorOperationsForDatabaseOperation
(EODatabaseContext.java:5548)
at
com
.webobjects
.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:
6365)
at
com
.webobjects
.eocontrol
.EOObjectStoreCoordinator
.saveChangesInEditingContext(EOObjectStoreCoordinator.java:415)
at
com
.webobjects
.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3226)
at com.webobjects.eodistribution.EODistributionContext
$
_RemoteMethodReceiver
.clientSideRequestSave(EODistributionContext.java:1071)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.webobjects.foundation.NSSelector.invoke(NSSelector.java:354)
at
com
.webobjects
.foundation.NSSelector._safeInvokeSelector(NSSelector.java:108)
at
com
.webobjects
.eodistribution
.common
._EOServerInvocation.doInvokeWithTarget(_EOServerInvocation.java:
140)
at
com
.webobjects
.eodistribution
.EODistributionContext
._processClientRequest(EODistributionContext.java:488)
at
com
.webobjects
.eodistribution
.EODistributionContext
.responseToClientMessage(EODistributionContext.java:577)
at
com
.webobjects
.eodistribution
.WOJavaClientComponent
.handleClientRequest(WOJavaClientComponent.java:1105)
at
com
.webobjects
.eodistribution
.WOJavaClientComponent.invokeAction(WOJavaClientComponent.java:343)
at
com
.webobjects
.appserver
._private
.WOComponentReference.invokeAction(WOComponentReference.java:104)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:
101)
at
com
.webobjects
.appserver
._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at
com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:
945)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:
1168)
at
com
.webobjects
.appserver.WOApplication.invokeAction(WOApplication.java:1375)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedPage(WOComponentRequestHandler.java:196)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._dispatchWithPreparedApplication(WOComponentRequestHandler.java:
322)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
._handleRequest(WOComponentRequestHandler.java:358)
at
com
.webobjects
.appserver
._private
.WOComponentRequestHandler
.handleRequest(WOComponentRequestHandler.java:432)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
_______________________________________________
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
_______________________________________________
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
--
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