thanx for all the replies.

i found the solution with a single select and update, it was a simple
update(how did i miss tht???)
but what if i want to do a compelete transaction with row level locking
in consideration, as thr can be time lag between the queries(select and
update) so a row level locking.

On Fri, 2004-04-16 at 21:42, Paul DuBois wrote:

> At 18:57 +0530 4/16/04, Sahil Aggarwal wrote:
> >hi all,
> >
> >i have select statements in my java code which are followed by updates
> >in my Innodb table.
> >the desired behaviour shud have been
> >check and then update
> >but because of tomcat accepting connections the above becomes
> >check check update update
> >i dont want to set the table locking, as it will make the system slower
> >how can i set exclusive row locking until the update is finished?
> 
> Have you tried using SELECT ... FOR UPDATE?
> 
> 
> -- 
> Paul DuBois, MySQL Documentation Team
> Madison, Wisconsin, USA
> MySQL AB, www.mysql.com

Sahil Aggarwal
www.vfirst.com

Reply via email to