Hi Miroslav,

Miroslav Lazarevic' wrote:
Hi,

I have a question about collection descriptor's auto-retrieve, auto-update and auto-delete attributes when using ODMG API. In documentation is written that for OTM, ODMG and JDO auto-retrieve="true", auto-update="false" and auto-delete="false".

that's still correct!


I have a two classes which everyone contain collections of eachother. When I store object using ODMG API I get only that object inserted in database without inserted collection's data in third table which serve to contain M:N mappings data. If I manually add row in that table when loading object then I get collection filled from that help table as expected. I suppose that it's happend because auto-retrieve is true for ODMG. Should I must do any extra work to make this collection updateable when using ODMG?

Yes, you have to lock the elements of the N side collection to the open ODMG transaction!
Otherwise OJB/ODMG won't detect the changes to those objects and thus won't perform any updates for them.


If you are using the ODMG persistent collections like DList you don't have to do the locking, as they cooperate with the transaction mechanism.

DLists are also very handy for m:n associations, as you don't need an intermediary table, OJB is doing all the management stuff for you...

cheers,
Thomas





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to