Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: DBI and last_insert_id

by cog (Parson)
on Jan 29, 2009 at 11:26 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://739865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-03-19 03:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found