Owen,

When you have a to-one relationship that's mandatory, EOF will automatically create the related object for you. If you then create your own and call the to-one relationship set method, the one EOF created for you will just be floating around in the editing context. So, the one you created will save fine, and the one created by EOF will not be initialized. That's usually the problem with your set of circumstances.

Ken

On Jun 1, 2006, at 9:27 PM, Owen McKerrow wrote:

Hi All,

We're working with a 3rd Party DB that we can't modify the schema of and are receiving a strange error when trying to add a new row to a particular table.

Below is the SQL that WO is generating and below that the error that is produced. Its an Orcale 9i DB. However when we look at the DB the row has actually been added !

Any ideas on what's causing the error ? And why the row is still being made in the DB despite the fact that the Commit is meant to have failed.

"INSERT INTO TRACKINGOBJECTRESULTS
(RESTARTTOPIC,
HIGHQUIZDATE,
ATTEMPTS,
TRACKINGOBJECTSTATUS,
RESTARTID,
TRACKINGOBJECTID,
RECIPIENTID,
TRACKINGOBJECTSTARTDATE,
TRACKINGOBJECTSTATDATE,
SUBTOPICTRACKING,
TRACKINGOBJECTLASTDATE,
HIGHQUIZSCORE)

VALUES

(NULL, NULL, NULL, ?, NULL, ?, ?, ?, ?, NULL, ?, NULL)"

withBindings:
1:"1"(trackingObjectStatus),
2:"3"(trackingObjectId),
3:219(recipientId),
4:2006-06-02 10:08:46(trackingObjectStartDate),
5:2006-06-02 10:08:46(trackingObjectStatDate),
6:2006-06-02 10:08:47(trackingObjectLastDate)>



10:09:40,653 DEBUG [WorkerThread0] (Log.NSLogDebug:1546 appendln) - === Commit Internal Transaction 10:09:40,662 DEBUG [WorkerThread0] (Log.NSLogDebug:1546 appendln) - Commit failed on data source of type class com.webobjects.eoaccess.EODatabaseContext 10:09:40,678 DEBUG [WorkerThread0] (Log.NSLogDebug:1546 appendln) - java.lang.IllegalArgumentException: Attempt to insert null object into an com.webobjects.foundation.NSMutableDictionary. at com.webobjects.foundation.NSMutableDictionary.setObjectForKey (NSMutableDictionary.java:199) at com.webobjects.eoaccess.EODatabaseContext.commitChanges (EODatabaseContext.java:6515) at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditing Context(EOObjectStoreCoordinator.java:425) at com.webobjects.eocontrol.EOEditingContext.saveChanges (EOEditingContext.java:3226)
        at Main.save(Main.java:279)
        at Main.checkRecipient(Main.java:264)
        at Main.checkLogin(Main.java:115)





Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"I like the way this project has somehow, against all common sense, got itself made."
    - Peter Jackson,  "The Lord of The Rings"


_______________________________________________
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/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
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]

Reply via email to