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 12:00:22 UTC

Optimistic Locking 2

I was seeing the documentation about optimistic locking on Cayenne and this
phrase:

 

Cayenne is also smart enough to know which values have changed (only firstName)
and doesn't update the unchanged values.

 

Got me thinking... Does this means that if I change other fields (besides
firstName)on this records they get changed? My wish was not to change anything
on the record until all fields are consistent.

 

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 2

Posted by Bruno René Santos <br...@holos.pt>.
Ok Michael I got it. About the second email I misinterpreted the sentence.

Thanx a lot
Bruno

-----Mensagem original-----
De: Michael Gentry [mailto:mgentry@masslight.net] 
Enviada: segunda-feira, 22 de Novembro de 2010 15:18
Para: user@cayenne.apache.org
Assunto: Re: Optimistic Locking 2

I didn't entirely follow your question.  Cayenne only sends changes
for the fields that changed.  If you have an object with 50 attributes
and one of them is firstName and you only change the first name, then
only the firstName column is sent in the SET portion of the SQL.

UPDATE xyz SET firstName = 'new first name' WHERE ...

If you changed firstName and lastName, it would be:

UPDATE xyz SET firstName = 'new first name', lastName = 'new last
name' WHERE ...

Cayenne won't send all 50 attributes over in the SET clause unless all
50 change.  Cayenne is smart enough to know which attributes changed
and only send those.

mrg


On Mon, Nov 22, 2010 at 6:00 AM, Bruno René Santos <br...@holos.pt> wrote:
> I was seeing the documentation about optimistic locking on Cayenne and this
> phrase:
>
>
>
> Cayenne is also smart enough to know which values have changed (only
firstName)
> and doesn't update the unchanged values.
>
>
>
> Got me thinking... Does this means that if I change other fields (besides
> firstName)on this records they get changed? My wish was not to change anything
> on the record until all fields are consistent.
>
>
>
> 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 2

Posted by Michael Gentry <mg...@masslight.net>.
I didn't entirely follow your question.  Cayenne only sends changes
for the fields that changed.  If you have an object with 50 attributes
and one of them is firstName and you only change the first name, then
only the firstName column is sent in the SET portion of the SQL.

UPDATE xyz SET firstName = 'new first name' WHERE ...

If you changed firstName and lastName, it would be:

UPDATE xyz SET firstName = 'new first name', lastName = 'new last
name' WHERE ...

Cayenne won't send all 50 attributes over in the SET clause unless all
50 change.  Cayenne is smart enough to know which attributes changed
and only send those.

mrg


On Mon, Nov 22, 2010 at 6:00 AM, Bruno René Santos <br...@holos.pt> wrote:
> I was seeing the documentation about optimistic locking on Cayenne and this
> phrase:
>
>
>
> Cayenne is also smart enough to know which values have changed (only firstName)
> and doesn't update the unchanged values.
>
>
>
> Got me thinking... Does this means that if I change other fields (besides
> firstName)on this records they get changed? My wish was not to change anything
> on the record until all fields are consistent.
>
>
>
> 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
>
>
>
>