You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bruno René Santos <br...@holos.pt> on 2010/11/22 11:42:19 UTC

Optimistic Locking

Hello all,

 

I have a doubt about optimistic locking. When the lock fails (concurrent access)
the DB transaction is rollbacked but what about the ObjectEntities? Are they
rollbacked too (with context.rollbackChanges())? The situation here is that I
wanted to do commit retries when the lock fails but i needed to be sure that the
information on the objects is not rollbacked but the information on the DB is.

 

Thanx

Bruno

 

-- 



Bruno René Santos | Gestor de Projectos - Project Manager |
<ma...@holos.pt> brunorene@holos.pt |  <http://www.holos.pt>
http://www.holos.pt

 

Holos - Soluções Avançadas em Tecnologias de Informação S.A. 

Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque 

Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica 

Phone: +351 210 438 686 . Fax: +351 210 438 687 

 

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you are not the intended recipient or the person responsible for delivering the
email to the intended recipient, be advised that you have received this email in
error and that any use, dissemination, forwarding, printing, or copying of this
email is strictly prohibited. If you have received this email in error please
notify Bruno René Santos by telephone on +351 210 438 686

 


Re: Optimistic Locking

Posted by Michael Gentry <mg...@masslight.net>.
Hi Bruno,

When Cayenne throws an optimistic locking exception, it doesn't
automatically rollback changes in your objects.  The commit to the
database failed.  Whatever you had in memory stays the way you had it
and whatever was in the database is unaltered there.

mrg


On Mon, Nov 22, 2010 at 5:42 AM, Bruno René Santos <br...@holos.pt> wrote:
> Hello all,
>
>
>
> I have a doubt about optimistic locking. When the lock fails (concurrent access)
> the DB transaction is rollbacked but what about the ObjectEntities? Are they
> rollbacked too (with context.rollbackChanges())? The situation here is that I
> wanted to do commit retries when the lock fails but i needed to be sure that the
> information on the objects is not rollbacked but the information on the DB is.
>
>
>
> Thanx
>
> Bruno
>
>
>
> --
>
>
>
> Bruno René Santos | Gestor de Projectos - Project Manager |
> <ma...@holos.pt> brunorene@holos.pt |  <http://www.holos.pt>
> http://www.holos.pt
>
>
>
> Holos - Soluções Avançadas em Tecnologias de Informação S.A.
>
> Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque
>
> Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica
>
> Phone: +351 210 438 686 . Fax: +351 210 438 687
>
>
>
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed. If
> you are not the intended recipient or the person responsible for delivering the
> email to the intended recipient, be advised that you have received this email in
> error and that any use, dissemination, forwarding, printing, or copying of this
> email is strictly prohibited. If you have received this email in error please
> notify Bruno René Santos by telephone on +351 210 438 686
>
>
>
>