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 16:15:28 UTC

RE : RE : Qury on an object Locked but not in Db

Thanks a lot Charles.

That 's great !


-----Message d'origine-----
De : Charles Anthony [mailto:charles.anthony@hpdsoftware.com] 
Envoyé : jeudi 7 août 2003 16:07
À : 'OJB Users List'
Objet : RE: RE : Qury on an object Locked but not in Db

Hi,

No, not true.

"flush" will push all the INSERTS and UPDATES through to the underlying db
connection, but does *not* call connection.commit();

Any queries on the same thread will go through to the same connection, which
means you can query for the object.

So, no you can't rollback an entire ODMG transaction after a checkpoint(),
but you can roll back an entire OJB TransactioExt with a flush() 

Cheers,

Charles.

>-----Original Message-----
>From: Gelhar, Wallace Joseph [mailto:gelharwj@uwec.edu]
>Sent: 07 August 2003 15:03
>To: OJB Users List
>Subject: RE: RE : Qury on an object Locked but not in Db
>
>
>If he doesn't commit to the db, he can't query for the object, true?
>
>Then the question is can you rollback an entire ODMG 
>transaction after calling checkpoint()?
>
>-Wally
>
>-----Original Message-----
>From: Charles Anthony [mailto:charles.anthony@hpdsoftware.com] 
>Sent: Thursday, August 07, 2003 8:57 AM
>To: 'OJB Users List'
>Subject: RE: RE : Qury on an object Locked but not in Db
>
>
>Hi Emmanual,
>
>See the recent thread "Re: checkpoint problem" on the 
>developers mailing list and/or the archives.
>
>In CVS, the checkpoint methods has been changed to commit the 
>underlying database transaction, but to retain the locks. This 
>is the way other ODMG implementations handle checkpoint. 
>
>We have retained the old behaviour in a new method called 
>"flush". I believe that you should be able to cast Transaction 
>to TransactionExt and invoke "flush" e.g.
>
>Transaction tx = ......
>
>TransactionExt extendedTransaction = (TransactionExt) tx; tx.flush();
>
>Cheers,
>
>Charles
>
>
>>-----Original Message-----
>>From: Emmanuel Dupont [mailto:emmanuel.dupont@jwaretechnologies.com]
>>Sent: 07 August 2003 14:51
>>To: 'OJB Users List'
>>Subject: 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
>>
>
>
>This email and any attachments are strictly confidential and 
>are intended solely for the addressee. If you are not the 
>intended recipient you must not disclose, forward, copy or 
>take any action in reliance on this message or its 
>attachments. If you have received this email in error please 
>notify the sender as soon as possible and delete it from your 
>computer systems. Any views or opinions presented are solely 
>those of the author and do not necessarily reflect those of 
>HPD Software Limited or its affiliates.
>
> At present the integrity of email across the internet cannot 
>be guaranteed and messages sent via this medium are 
>potentially at risk.  All liability is excluded to the extent 
>permitted by law for any claims arising as a re- sult of the 
>use of this medium to transmit information by or to 
>HPD Software Limited or its affiliates.
>
>
>
>---------------------------------------------------------------------
>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
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



---------------------------------------------------------------------
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