Sorry I should have read this message first. >From: Paul DuBois <[EMAIL PROTECTED]> > >>The problem is not about your own thread doing several related updates, >>but some other thread doing an INSERT just after you do, >>and before you get a chance to SELECT LAST_INSERT_ID() >> >>If there is any chance of it (anything except a single user can do it) >>you must ensure thread safety with either single-thread attribute, >>or synchronize (this) on the block. > >I'll repeat my response to Peter's message: > > >Not true. LAST_INSERT_ID() guarantees that you get the AUTO_INCREMENT >value generated on your own connection, regardless of what any other >clients are doing. > >This assumes that you use <sql:transaction> (as per Shawn's message), >to make sure that the query that generates the AUTO_INCREMENT value >and the query that selects it are issued using the same connection.
But why is it even necessary to use <sql:transaction> ? Is it enough that the JSP uses the same database connection for all <sql: > tags on the page ? I think so. How do DBTags do database connection pooling ? Soefara Redzuan. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>