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

Re^2: Nested (sql) transactions

by clueless newbie (Hermit)
on Feb 04, 2012 at 01:12 UTC ( #951742=note: print w/ replies, xml ) Need Help??


in reply to Re: Nested (sql) transactions
in thread Nested (sql) transactions

tobyink:Your code, as I understand it, when it wants a nested transaction, opens a new database connection, runs the nested transaction there, and holds the transaction open until it's sure the outer transaction is ready to commit. It's a reasonable solution in the case where you're on a database that does transactions but not savepoints.

However, I think it probably has some flaws. You'd typically want code running in an inner transaction to be able to "see" database changes already made in the outer transaction. But if your database is doing ACID properly, then an independent transaction on a second database connection will not be able to see the changes made in the initial transaction until that initial transaction has been committed.

clueless:Thank you for those thoughts. It doesn't require opening a new database connection. No doubt my example was somewhat misleading.

It leaves a lot to be desired as far as ACID is concerned.


Comment on Re^2: Nested (sql) transactions

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-12-27 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls