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 Emmanuel Dupont <em...@jwaretechnologies.com> on 2003/08/07 15:50:48 UTC

RE : Qury on an object Locked but not in Db

Thanks a lot for your reply Thomas,

I'm oK to your solution; the only trouble is that I can't do a Rollback avec
the checkpoint if I need to cancel all the operations.

Isn't it?


-----Message d'origine-----
De : Mahler Thomas [mailto:thomas.mahler@itellium.com] 
Envoyé : jeudi 7 août 2003 13:20
À : 'OJB Users List'
Objet : RE: Qury on an object Locked but not in Db

All OQL queries are executed as SQL queries against the DB.
In your case the object was nos written to the DB, so a query won't be able
to find it.

But you could try the following:
Transaction tx = ...;
A objA = new A();
objA.setName("Smith");
tx.lock (objA);
tx.checkpoint();

loadObjectByQuery();

checkpoint writes to DB but keeps the tx open and also maintains the lock on
objA.
The DB should be able to find ojbA by an SQL query then...

cheers,
Thomas


> -----Original Message-----
> From: Emmanuel Dupont [mailto:emmanuel.dupont@jwaretechnologies.com]
> Sent: Wednesday, August 06, 2003 5:36 PM
> To: OJB Users List
> Subject: Qury on an object Locked but not in Db
> 
> 
> All,
> 
>  
> 
> Is it possible to do such thing :
> 
>  
> 
>  
> 
> A objA = new A();
> 
> objA.setName("Smith");
> 
>  
> 
> Lock (objA);
> 
>  
> 
> [...]
> 
>  
> 
> No commit is done and later if I want to work with objA, 
> could I query to
> OJB to find my right A instance with getObhjectByQuery() 
> something else ?
> 
>  
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org