On Feb 13, 2006, at 1:39 PM, Perrin Harkins wrote:
Perrin- I would test this myself... except that, crazy as it
sounds, I'm
not currently using mod_perl.
It doesn't matter -- you can test this from any old command-line
script.
Just open a connection, do an insert that works, do one that doesn't
work (duplicate key or something), and check the isertid.
In my use, it doesn't even matter if DBI would cache the insert id or
not:
My logic always looks as such:
10 insert OR catch fail and return w/error (rollback, setError ,etc)
20 implicit success - store insert id
I can't see any reason why you would continue with a transaction/
function if you're expecting a new insert_id and the transaction
fails - you should catch the error and do the appropriate steps -
and not need to worry about looking for the insert id