OJB caching and concurrent access

Bernd Längerich <[email protected]> Wed, 18 Mar 2009 16:25:23 +0100
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Hello,

I use the PB-API. Is there any support for concurrent access to the same da=
ta base entries from multiple servers/applications in OJB? In order to prov=
ide a scalable system and high availability, I am faced with the demands of=
 load balancing and multiple servers running the same application and servi=
ce. At the moment, multiple servers could obtain the same object instance f=
rom the database, caching them, perform changes and possibly updating the d=
ata base without notification of their neighbors. Completely turning off ca=
ching is no real option at the moment.

At the moment, my approach would be to lock the rows in the database during=
 transaction processing, thus disabling concurrent access to these entries.=
 After transaction is done, the instance would be held in cache. If subsequ=
ent transactions are scheduled to the same server, everything is fine, but =
there is a possibility that another server is scheduled one transaction, ma=
king the cached instance obsolete. The best solution would be, that the obj=
ect instance remains in cache, but are updated from the database when reque=
sted.

Best regards

Bernd