Re: ODMG Delete : markDelete or deletePersistent
Armin Waibel <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
Bruno CROS wrote: > Looking into OJB implemenations, it seems that deletePersistent use the > transaction of the current thread. So ok for the SQL transaction sequence, > sorry for asking in last mail. I was confused between > DB.deletePersistent(o), > ExtTx.markDelete(o), and ExtTx.deletePersistent(o) methods. It seems all do > the same. They are nearly the same (see my previous post). > > I can't get rid of those dead lock, occurring when update/delete object > in complex and different transactions. > > Do i have to lock objects to be deleted to avoid concurrent updating > transaction (plausibly locking DB records) ? If you use DB.deletePersistent(o) the object will be immediately (write) locked, thus it couldn't happen that another tx locks the same object too (ExtTx.markDelete(o) doesn't write lock the object itself, thus you first have to write lock it). regards, Armin > > Does someone use such a technique ? > > Thanks for help. > > > On 12/8/06, Bruno CROS <[email protected]> wrote: >> >> >> Hi, >> >> Just one question. >> >> Using ODMG, if deletePersistent(o) is called from the Impl.getDatabase(), >> how "SQL DELETE" query post can be done with the other >> "INSERT/UPDATE" in >> the same SQL transaction without refering THE transaction? Why ODMG >> delete >> object tutorial talk about deletePersitent way, whereas >> ExtTx.markDelete(o) would >> be more appropriate considering SQL queries sequence in transaction? >> >> Need help. >> >> Regards. >> >> Bruno >> >