AW: [Objectbridge-developers] Querying databases (including local transactions changes)
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-08-10 12:00:41
|
Hi Geir Ove, Hello all! I really haven't started using ObjectBridge yet, but I have some experience already using TopLink and Castor JDO. I've been able to successfully use TopLink in the project doing. Unfortunately TopLink is extremely expensive and the licensing is not really very flexible for the use I'm interested in. Secondly being able to peek at the source code whenever I'm stuck is _extremely_ useful to say the least. So, I tried switching to Castor JDO, which I have the impression is quite a nice framework. From what I've seen so far - it is. Unfortunately my project rely heavily on querying the object model during transactions (before commiting), so the query results must be conformed with the local transaction changes somehow. I'm not quite sure if I get you mean by "conformed with". Do you mean the following? say you have a class Articles with an attribute price. You perform a query with price < 100. Then you operate on the found articles and for some articles you set the price to 250. Then you perform the query again (within the same tx) and want to have the objects with price set to 250 NOT included in the query result? This is a thing OJB can't do as all queries are translated to SQL and go to the database (and do not work on in-memory objects). Or do you mean the following: during a transaction you change an article A to A' and then perform (within same tx) a query that returns also article A. You want of course to see your modified article A' and not the original A. This works with OJB due to its caching algorithms. TopLink has a feature called conformInUnitOfWork, which lets you do this. There were some missing parts, but I where able to tweak everything to make this work. TopLink doesn't actually modify the database until commit at all (except for sequence counters that is). So TopLink was up to the task. In OJB there are also NO database write until a commit ist performed. (except for sequence counters...) Then I tried Castor which actually modifies the database whenever objects are created (inserts a row with the default values), and on commit (of course), but not when they are modified. Castor does not, like TopLink, have support for conforming query results in-memory. It does also not have support for something like a 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. The OJB ODMG implementation supports checkpoints. Currently they have the same semantics as commits. :-( But this could easily be changed. HTH Thomas I guess savepoint would also be the most efficient way of supporting such a feature - at least if there were support to actually only store modifications that are relevant to the query you've about to execute. In TopLink this is often not very efficient, since it is very hard upfront knowing how to store the changes to efficiently sync the database result with the inmemory-result. Does ObjectBridge have support for conforming queries either in-memory or in the database via savepoints? All the best, Geir O. _______________________________________________ Objectbridge-developers mailing list Obj...@li... http://lists.sourceforge.net/lists/listinfo/objectbridge-developers <http://lists.sourceforge.net/lists/listinfo/objectbridge-developers> |