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 "Kollivakkam R. Raghavan" <rk...@cisco.com> on 2004/06/17 00:00:57 UTC
Question on update processing
When we store data into a database using OJB, in order to solve the
concurrent change issue we're created a col called mod_num (integer)
which we are setting up to auto increment on each update to that row.
The idea is to not allow a change to happen if the mod_num in the db
does not match the value in the data object (i.e. someone else has
updated the record).
2 questions:
1. Is this the best way to do this?
2. If this is acceptable (I've seen other commercial software use this
mechanism), then what's the best way to setup OJB to help me without
everyone having to worry about this logic
Thanks
Raghavan
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Question on update processing
Posted by Armin Waibel <ar...@apache.org>.
Hi Raghavan,
Kollivakkam R. Raghavan wrote:
> When we store data into a database using OJB, in order to solve the
> concurrent change issue we're created a col called mod_num (integer)
> which we are setting up to auto increment on each update to that row.
> The idea is to not allow a change to happen if the mod_num in the db
> does not match the value in the data object (i.e. someone else has
> updated the record).
>
> 2 questions:
> 1. Is this the best way to do this?
> 2. If this is acceptable (I've seen other commercial software use this
> mechanism), then what's the best way to setup OJB to help me without
> everyone having to worry about this logic
this sounds like optimistic locking. Please have a look at
http://db.apache.org/ojb/docu/faq.html#optimisticLocking
regards,
Armin
>
> Thanks
> Raghavan
>
>
> ---------------------------------------------------------------------
> 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