Just from the docs, that looks to be solved by the <selectKey> statements in 2.0 - Is that an option?
/Gwyn On 31/07/06, Fred Janon <[EMAIL PROTECTED]> wrote:
Sorry for the repost, but I am atill looking for an answer to my question. Basically I need to do an INSERT and get the ID (PK) of the insert in mySQL. MySQL has the "last_insert_id()" function to do that but it has to be executed in the same connection as the INSERT, otherwise it returns 0. I have 2 mapped statements in my XML maps, one to do the insert and one to do the last_insert_id(). I need to find a way to execute them in the same connection. I tried to include the 2 stements in a transaction but they are still executed in 2 connections.
