db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: [VOTE] Release OJB 1.0.1
Date Fri, 30 Jul 2004 19:10:09 GMT
hi armin,

storing the single-refs *before* storing the mainObj solves the problem:

         Transaction tx = odmg.newTransaction();
         tx.begin();
         db.makePersistent(s_ref_1);
         db.makePersistent(s_ref_2);
         db.makePersistent(s_ref_3);
         db.makePersistent(s_ref_4);

         db.makePersistent(obj_1);
         db.makePersistent(obj_2);
         tx.commit();

so what's wrong with this ? is the odmg-api supposed to be able to solve this 
problem without a little help from the user ?

jakob

Jakob Braeuchi schrieb:

> hi armin,
> 
> i was debugging NativeIdentifierTest#testReferenceInsertUpdateODMG for 
> quite some time and unfortunately i do not see a solution to this 
> problem :(
> 
> we have a mainObject with a 1:1 relationship to a SingleReference. 
> during tx.commit the mainObj is save first, storeReferences does NOT 
> save this singleRef because of auto-settings set to false. afterStore of 
> mainObj the db-generated key is put into the object. i tried to call 
> setReferenceFKs in afterStore, but this is useless because singleRef is 
> not saved and still carries the dummy key !
> 
> so, imo we cannot insert the mainObj referencing a non existent singleRef !
> evene if we could update all the fks in the mainObj the row in the 
> database is still wrong, because it contains to dummy key of the singleRef:
> 
> INSERT INTO NATIVE_MAIN_OBJECT (REF_ID,NAME) VALUES 
> ('-2','testReferenceInsert_main_1091213387781')
> 
> this actually only works because there are no referential constraints.
> 
> jakob
> 
> 
> Armin Waibel schrieb:
> 
>> Jakob Braeuchi wrote:
>>
>>> hi armin,
>>>
>>> are you solving this issues for 1.0.1 ?
>>>
>>
>> I will try to do so, but concurrently I'm working on the 1.1 stuff so 
>> any help is much appreciated.
>>
>> Armin
>>
>>> jakob
>>>
>>> Armin Waibel schrieb:
>>>
>>>> Hi all,
>>>>
>>>> Brian McCallister wrote:
>>>>
>>>>> We have a number of user-requested bug fixes in the OJB_1_0_RELEASE 
>>>>> branch at the moment. I'd like to push a release.
>>>>>
>>>>
>>>> There are some open issues (2 failing odmg-test cases, 
>>>> CollectionTest) and a serious bug in FK assignment when odmg-api was 
>>>> used with native DB Identity columns (SequenceManagerNativeImpl). 
>>>> NativeIdentifierTest, on insert of objects with 1:1 references. 
>>>> Problem occurs in TransactionImpl#lock(Object obj, int lockMode) 
>>>> line 235.
>>>>
>>>> When using native Identity columns, OJB use a temporary dummy value 
>>>> for created OJB Identity objects of new pc objects (negative long 
>>>> values are used as dummy values for Identity columns), so the FK 
>>>> assignment is only valid after store of the referenced object.
>>>> TransactionImpl#lock assign the FK before the referenced object was 
>>>> written to DB.
>>>>
>>>>
>>>> regards,
>>>> Armin
>>>>
>>>>> +1/0/-1
>>>>>
>>>>> Vote will end Sunday, Aug 1.
>>>>>
>>>>> -Brian
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message