ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Fereira <ja...@cornell.edu>
Subject Re: execute SQL statement that are not in a map
Date Sun, 27 Mar 2005 16:08:11 GMT
At 08:47 AM 3/27/2005 -0700, Brandon Goodin wrote:
>I don't think you need to worry about LAST_INSERT_ID so long as you
>have the same connection that inserted it. With IBatis this is not a
>problem.
>
>"The last ID that was generated is maintained in the server on a
>per-connection basis. This means the value the function returns to a
>given client is the most recent AUTO_INCREMENT value generated by that
>client. The value cannot be affected by other clients, even if they
>generate AUTO_INCREMENT values of their own. This behavior ensures
>that you can retrieve your own ID without concern for the activity of
>other clients, and without the need for locks or transactions."

The paragraph above assumes that the "client" always holds onto the same 
database connection.  In the case where a framework (i.e. Spring) is 
managing the database connections, perhaps using commons-dbcp, wouldn't it 
be possible that it would grab a connection from the pool, execute the 
insert, then release it back to the pool?
John Fereira
jaf30@cornell.edu
Ithaca, NY



Mime
View raw message