RE: [OJB-developers] Bug in ODMG transaction
Brought to you by:
thma
From: Bischof, R. <rai...@ed...> - 2002-03-06 10:10:37
|
Thomas, thanks for clarification. I had seen these notes but somehow I thought that this only affects the ODMG collections not ODMG in general. cu Rainer -----Original Message----- From: Thomas Mahler [mailto:tho...@ho...] Sent: Dienstag, 5. Marz 2002 18:22 To: Bischof, Rainer Cc: OJB Subject: Re: [OJB-developers] Bug in ODMG transaction Hi again Rainer, Bischof, Rainer wrote: > Hi, > > I just moved to the current release which should fix some bugs with foreign > keys and the ODMG interface. I discovered two more: > > 1. Object A references Object B of a different class in a 1-1 relationship. > A's PK consists only of the reference to B (i.e. B's PK, which is > auto-incremented). Both objects are newly created and properly locked with > the ODMG transaction. B's PK is incremented at that time but A's FK to B is > not updated at that time (this is done only in broker.store). Therefore A's > FK to B is 0 which does not work. OJB places a lock on an object whose PK is > not yet defined. > Solution: FKs must be assigned before the lock is performed. I modified the > TransactionImpl to do this by copying the methods of the broker that perform > that to the TransactionImpl. That's just a quick and ugly hack but works. > Thanks for your patch. I will have a look at this issue > > 2. Object A holds a collection of Bs. Auto-Update is set to true in the > repository. I create A and lock it, than I create some Bs, lock them and add > them to A's collection. On commit the ObjectEnvelopeTable first stores A > which also stores it's collections. Afterwards the ObjectEnvelopeTable goes > through the ObjectEnvelopes of all Bs. All of these Bs have a StateNewDirty > which always creates INSERT statements. But the Bs have already been stored > as part of A's collection. > > I currently do not have the time to provide a proper fix for this ( I just > switched of AutoUpdate and it worked for me). > Auto-Update and -Delete *must not* be set to true if working with the ODMG Implementation. There is no fix for this, it just does not work! This is stated in http://objectbridge.sf.net/tutorial3.html#cascading. cu, Thomas > Regards > Rainer > > > |