AW: [Objectbridge-developers] Querying databases (including local transactions changes)
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-08-10 12:08:58
|
Hi again, > -----Urspr=FCngliche Nachricht----- > Von: Geir Ove Gr=F8nmo [mailto:gr...@on...] > Gesendet: Freitag, 10. August 2001 10:27 > An: obj...@li... > Betreff: Re: [Objectbridge-developers] Querying databases (including > local transactions changes) >=20 >=20 > * Geir Ove Gr=F8nmo > | It does also not have support for something like a=20 > savepoint where the > | changes up till the current point in the transaction is actually > | stored in the database without the transaction being commited. This > | would allow the query results to be conformed automatically by the > | database. > |=20 > | I guess savepoint would also be the most efficient way of = supporting > | such a feature - at least if there were support to actually=20 > only store > | modifications that are relevant to the query you've about to > | execute. In TopLink this is often not very efficient, since=20 > it is very > | hard upfront knowing how to store the changes to=20 > efficiently sync the > | database result with the inmemory-result. > |=20 > | Does ObjectBridge have support for conforming queries=20 > either in-memory > | or in the database via savepoints? >=20 > Being able to just save individual objects (not necessarily all > transaction changes) in the database should be sufficient for=20 > my current > needs. >=20 > PersistenceBroker.savepoint() or PersistenceBroker.save(Object = object) > would be fine. :) The PersistenceBroker.store(object) method works in two modi: 1. No call to PersistenceBroker.beginTransaction() has been made (i.e. connection.autoCommit =3D true). Then all store() Operations are directly written to the DB AND = commited. 2. PersistenceBroker.beginTransaction() has been called. Then the database inserts and updates are excecuted, but commit is done = only on a subsequent call to PersistenceBroker.commitTransaction() I'm planning to have a special operation likePersistenceBroker.storeImmediate(object) that ignores all = transactions and directly commits it's operations. I will need this feature for a database lock handling (I want to maintain a table that keeps track of transactional locks on objects.) If you urgently need this I could try = to code a bit faster :-) cheers Thomas >=20 > Does PersistenceBroker.store(Object object) actually do this? The > javadoc is somewhat unclear on whether the database is modified or = not > when this method is called. Are related objects also stored=20 > when calling > this method? >=20 > Geir O. >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > http://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |