I'm having trouble with this certain scenario and wanted to ask if this sounds like a bug or if I'm doing something wrong, and I can supply more concrete examples.

3 types of objects. none are dependent. no bidirectional relationships, here but just related.

Lets call them Author, Book, and Article.

The Author just contains information, a Book object contains a reference to an Author. (but not dependent). An Article also contains a reference to an Author (can be an different author), it also references to a Book.

Loading, saving, updating Author and Book objects work fine.

The problem happens when I try to

1. Load Author (long transaction)
2. Load Book (long transaction, which also loads its own Author object)
3. Create an article, attach Author and Book to it.
4. create() the book to the database.

An exception is thrown stating that the Book links to another object which is not created/updated/loaded in this transaction. this is thrown by the commit() method.

I've been stepping through it with the debugger, and what seems to be happening is that somehow during the commit() phase, the Author object in the Book either:

1) gets changed to null if the author object is different than the article author object.
2) gets changed to the same reference to the article author if they were of the same object.

Whats more.. the information IS successfully saved in the database, and it's saved correctly. Castor is just throwing an error after the fact. Any ideas what could be causing this? If you want to see code examples I can try to supply, but the code here i have is rather convoluted.

I'm only using the JAR for Castor right now so I'm unable to step through the code of Castor itself with the debugger, but that was going to be my next step if nobody on this list has any good ideas.

-tim

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev

Reply via email to