You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Ma...@itelligence.de on 2002/12/20 10:54:38 UTC

Locking - on a DB-Level

Hi,
Is it possible to get a lock on a DB-Level, like a "select for update" on
Oracle?
The Lock you can obtain seems just to work inside memory and not on a
DB-Level.

thanks in advance

PS: working with ODMG on jakarta-ojb-0.9.7.






Re: Locking - on a DB-Level

Posted by Thomas Mahler <th...@apache.org>.
Hi Martin,

Martin.Harm@itelligence.de wrote:
> Hi,
> Is it possible to get a lock on a DB-Level, like a "select for update" on
> Oracle?
> The Lock you can obtain seems just to work inside memory and not on a
> DB-Level.

The OJB ODMG pessimistic locking does not use DB-Level locking. You can 
use an in-memory version that only works within one VM. But you can also 
use the PersistentLockManager that can manage multiple VMs (even accross 
different physical machines). You can set this up in OJB.properties.

We don't use DB-Level locking as it is implemented differently on 
different RDBMS platforms. Some databases (e.g. DB2) cannot even 
guarantee row-level locking, but have lock escalations to page or even 
table level!

There is no way to *implicitely* use "select for update".
But you can ask OJB for a JDBC connection and perform it *explicitely* 
if needed.

cheers,
Thomas


> thanks in advance
> 
> PS: working with ODMG on jakarta-ojb-0.9.7.
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
>