[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
saveChanges: how to debug?
- Subject: saveChanges: how to debug?
- From: susanne.schneider at interActive-Systems.de (Susanne Schneider)
- Date: Thu Nov 14 04:54:02 2002
Hello list,
I have a problem, where I have no idea at all where to look for a
possible solution.
A short description of the situation (WO 5.13 on Win2000Pro with Oracle
8i):
I want to manipulate a lot of EnterpriseObjects at one time and either
save all or nothing.
This result in long and slightly complicated methods where Objects are
compared, copied, created and deleted.
I do this in a class wich get the two originating EnterpriseObjects
(inserted into the sessions EditingContext) as well as the sessions
EditingContext in the constructor. Every other EnterpriseObject is
reached via these originating Objects or created and inserted in the
handed context, so there should be no problem concerning different
editingcontexts. Everything does as expected unless I call
context.saveChanges() in the end. This leads to the following exception:
java.lang.NullPointerException
at
com.webobjects.eoaccess.EOAdaptor.fetchedValueForValue(EOAdaptor.java:894)
at
com.webobjects.jdbcadaptor.JDBCAdaptor.fetchedValueForValue(JDBCAdaptor.java:414)
at
com.webobjects.eoaccess.EODatabaseContext.processSnapshotForDatabaseOperation(EODatabaseContext.java:5144)
at
com.webobjects.eoaccess.EODatabaseContext.createAdaptorOperationsForDatabaseOperation(EODatabaseContext.java:5274)
at
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:6134)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:396)
at
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:2498)
at ATDocumentHandler.mergeData(ATDocumentHandler.java:756)
....
The line number of my method mergeData() is the line where saveChanges()
is called. Setting EOAdaptorDebugEnabled=true reveals that after the
call of saveChanges there are first many select-statements going to the
DB. Then after a few inserts and updates the transaction is rolled back
and the exception is thrown. A look into the API tells me:
public Object fetchedValueForValue(Object value, EOAttribute att)
Returns the value that the receiver's database server would
ultimately store for value if it were inserted or updated in the column
described by att. Returns value unchanged if value is not a string,
number, date, or data object (that is, an instance of String, Number,
NSTimestamp, NSData, or one of their subclasses). The Framework uses
this method to keep Enterprise Object snapshots synchronized with
database values.
I double-checked my model that every type is correct transfered into
db-types, only String, Numbers and NSTimestamps are used. As far as I
can see, everything's fine there.
So, anybody any idea what could be wrong or how to debug this??
Any help would be very much appreciated!!
Regards,
Susanne
--
Susanne Schneider
Programming Unit / Knowledge-Acquisition
Software Developer
iAS interActive Systems
Gesellschaft fuer interaktive Medien mbH
Dieffenbachstr. 33 c
10967 Berlin
Germany
fon +49(0)30 69004-143
fax +49(0)30 69004-101
mail susanne.schneider@xxxxxxxxxxxxxxxxxxxxxx
URL http://www.interActive-Systems.de