Bruce,
I was manually handling the many-to-many relationship between Bs and Cs
because the Bs were already in a one-to-many relationship with As using
"depends". With this mapping, things work fine for create(), but not for
long transaction update() or short transaction change and commit().
Ilia,
I was, in fact, using update(a) and the short transaction change the A and
commit(). In both cases, when a new C was added to the A, causing the C to
be created, create()ing an association object in C.jdoAfterCreate() causes
an error in Castor.
I am now using Datbase.setAutoStore(true) and it is working with my "toy"
application.
-doug
-----Original Message-----
From: Ilia Iourovitski
To: [EMAIL PROTECTED]
Sent: 5/12/2002 1:04 AM
Subject: Re: [castor-dev] jdoAfterCreate() fails for object created during
updating
Bruce
It has nothing to do with long transactions. He is not calling update.
If those transactions are not concurrent
it should work.
Ilia
Bruce Snyder <[EMAIL PROTECTED]> wrote:
This one time, at band camp, Kvidera, Douglas said:
KD>In the mapping file, classes B and C "depends" on A. For the
many-to-many
KD>association between B and C, the association table is mapped to the
KD>C_A_Assoc class (which doesn't "depends"). Class C then implements
KD>jdoAfterCreate() and attempts to create() the appropriate C_A_Assoc
objects
KD>therein. When I do:
...
KD>And, yes, I ran the update transaction code on a clean database. It
seems
KD>Castor tries to reuse the identity of the association object
create()d in
KD>jdoAfterCreate() or the identity of the C object just created. This
happens
KD>if the object is created as a result of being added to a parent
object that
KD>is updated, but not if the object is created during its parent's
creation.
Doug,
Why are you manually handling the many-to-many u! sing a callback?
If the relationships between objects are mapped correctly, Castor
should handle it on its own.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
_____
Do You Yahoo!?
LAUNCH <http://rd.yahoo.com/welcome/*http://launch.yahoo.com> - Your
Yahoo! Music Experience
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev