Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: DBI and last_insert_id

by cog (Parson)
on Jan 29, 2009 at 11:26 UTC ( #739865=note: print w/ replies, xml ) Need Help??


in reply to Re: DBI and last_insert_id
in thread DBI and last_insert_id

True, but I'm not even getting the correct value in last_insert_id() even without it failing.


Comment on Re^2: DBI and last_insert_id
Download Code
Re^3: DBI and last_insert_id
by perrin (Chancellor) on Jan 29, 2009 at 16:56 UTC

    Ok, here are a couple more thoughts. First, is there possibly another insert in your real code between the first insert and your call to last_insert_id? A side effect of some sub call maybe?

    Second, you definitely should be able to see data you inserted during a transaction with a SELECT, even if the data is not committed yet, provided your queries are all coming from the same connection. That sounds very suspicious to me.

      ... is there possibly another insert in your real code between ...

      No, the statements are just one after the other and there's no call to any other methods in between.

      ... you definitely should be able to see data you inserted during a transaction with a SELECT ...

      I was under that impression too, but didn't think too much of it. Now that I have someone telling me that, I'm going to look into that. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://739865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-11-22 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (120 votes), past polls