that would explain some of the problems you're having. I thought the latest mysql supports subqueries.
http://dev.mysql.com/doc/mysql/en/Subqueries.html if you're not using the latest mysql, it might be a good idea to upgrade, so you can do this the simple way. I hope that helps peter On Thu, 30 Sep 2004 21:14:07 -0500, Mike Curwen <[EMAIL PROTECTED]> wrote: > Ok, since it's been brought forward... > > how do you update and retrieve all in one query? This is for: "I need a new > primary key, and I need it to be thread safe." > > something that would run on mysql? > > unless you can get this magic query, it's not quite as simple as "let the > databse handle it", is it? > > > > > > -----Original Message----- > > From: Peter Lin [mailto:[EMAIL PROTECTED] > > Sent: Thursday, September 30, 2004 7:42 PM > > To: Tomcat Users List; [EMAIL PROTECTED] > > Subject: Re: method level synchronization doesn't work > > > > > > that would be the easiest way. > > > > but you made it too easy, I thought people are suppose to > > suffer and stumble :) > > > > peter > > > > > > On Thu, 30 Sep 2004 17:46:51 -0400, Frank W. Zammetti > > <[EMAIL PROTECTED]> wrote: > > > Why not just let SQL do the update? Do the following: > > > > > > update my_table set counter_field = counter_field + 1 (where clause > > > here if needed) > > > > > > (off the top of my head, my syntax might be off) > > > > > > In other words, why not let the database handle the > > concurrency issue? > > > That's kind of what they're there for (partly anyway). > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
