Re: select lock - How reliable?

2004-01-09 Thread Alfredo Cole
El Jue 08 Ene 2004 19:56, Paul DuBois escribió: At 19:16 -0600 1/8/04, Alfredo Cole wrote: Hi: (...) The code I use is: select lock Sorry. It's select get_lock... get code add one to code write code release lock and select release_lock... That looks like pseudo code

Re: select lock - How reliable?

2004-01-09 Thread Michael Stassen
LAST_INSERT_ID() is connection specific, so it is safe from the concurrency issue. See http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html and http://www.mysql.com/doc/en/Getting_unique_ID.html for more. Michael Alfredo Cole wrote: El Jue 08 Ene 2004 19:56, Paul DuBois escribió: At 19:16

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
LAST_INSERT_ID() is connection specific, so it is safe from the concurrency issue. Note: safe may not apply if you're using connection pooling :-) -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder LAST_INSERT_ID() is connection specific, so it is safe from the concurrency issue. Note: safe may not apply if you're using connection pooling :-) In what situation is this unsafe? In general, you would not call LAST_INSERT_ID() without first having done an INSERT in the

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
Roger Baklund wrote: LAST_INSERT_ID() is connection specific, so it is safe from the concurrency issue. Note: safe may not apply if you're using connection pooling :-) In what situation is this unsafe? In general, you would not call LAST_INSERT_ID() without first having done an INSERT in the same

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder In what situation is this unsafe? In general, you would not call LAST_INSERT_ID() without first having done an INSERT in the same session, and even with connection pooling you would usually use the same connection for all statements related to a session. What am I

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
... and of course the _point_ of connection pooling: one assumes that there is overhead involved connecting to the server, thus you would avoid a lot of connect/one-small-session/close and instead have fewer connect/many-small-sessions/close. It is relatively fast to connect to MySQL, making

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
Roger Baklund wrote: Maybe I don't understand connection pooling, then. Isn't its purpose to allow a client -- say, a webapp running in Tomcat -- to multiplex requests for *multiple* end users over a single connection? Almost... except for the 'single connection' part. It will maintain a pool of

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder [...] OK, but the user here is the servlet container (Tomcat), *not* the human end user. That should not make a difference, as seen from the server a client is a client. As would temporary tables, which is why I stopped using them for request-specific data :-) Right...

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
Roger Baklund wrote: OK, but the user here is the servlet container (Tomcat), *not* the human end user. That should not make a difference, as seen from the server a client is a client. Huh? OK, Tomcat is the client of the MySQL server; user or client, same situation. As would temporary tables,

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder [...] Not errors, just the same temp table being shared across end user requests. ok... If you did this: - create temp table - use temp table - drop temp table for each session, I would expect it to work. (atleast until a session crashes before it drops the temp table.)

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
Roger Baklund wrote: ok... If you did this: - create temp table - use temp table - drop temp table for each session, I would expect it to work. (atleast until a session crashes before it drops the temp table.) This is straying from the original question :-) but my understanding of temp tables is

Re: select lock - How reliable?

2004-01-09 Thread William R. Mussatto
Hassan Schroeder said: Roger Baklund wrote: Maybe I don't understand connection pooling, then. Isn't its purpose to allow a client -- say, a webapp running in Tomcat -- to multiplex requests for *multiple* end users over a single connection? Almost... except for the 'single connection' part.

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder Roger Baklund wrote: ok... If you did this: - create temp table - use temp table - drop temp table for each session, I would expect it to work. (atleast until a session crashes before it drops the temp table.) This is straying from the original question :-)

Re: select lock - How reliable?

2004-01-09 Thread Hassan Schroeder
Roger Baklund wrote: Ouch. Very special, imo... this means the connection is re-negotiated for each statement? Sounds strange. Maybe the client connection is 'virtual' or 'by proxy', so that multiple users actually share the same connection at the same time? If you want to think of it that way,

Re: select lock - How reliable?

2004-01-09 Thread Roger Baklund
* Hassan Schroeder Roger Baklund wrote: Ouch. Very special, imo... this means the connection is re-negotiated for each statement? Sounds strange. Maybe the client connection is 'virtual' or 'by proxy', so that multiple users actually share the same connection at the same time? If you

Re: select lock - How reliable?

2004-01-09 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roger Baklund wrote: [snip] A connection pooling implementation without this isolation, where multiple users can share the same database connection at the same time is either broken or intended for a special purpose (some non-multi-statement

select lock - How reliable?

2004-01-08 Thread Alfredo Cole
Hi: I have an application that is used by around 40 users who need to access a table, obtain a sequential code, and write it back. I'm using MyISAM tables, and mysql 3.23 running under LM 9.0. A couple of times during the day, the users get the same code, and that is causing us many problems.

Re: select lock - How reliable?

2004-01-08 Thread Paul DuBois
At 19:16 -0600 1/8/04, Alfredo Cole wrote: Hi: I have an application that is used by around 40 users who need to access a table, obtain a sequential code, and write it back. I'm using MyISAM tables, and mysql 3.23 running under LM 9.0. A couple of times during the day, the users get the same