Andre Matos wrote:

Hi List,

Let's suppose that I have this sequence of events:

- create a connection "1"
-- start a transaction
--- create a new connection "2"
---- insert a new record "named B"
--- close the connection "2"
--- insert a new record "named A"
-- rollback
- close the connection "1"

This sequence will be written in PHP4. My question is:

Will the record "named B" be written in the database or it will be rollback
with the record "named A"?

Thanks for any help!!!

Andre

--
Andre Matos
[EMAIL PROTECTED]





Your line 'start a transaction' should be specific to a connection ... maybe PHP lets you skip specifying the connection if there is only one active connection.

If you start a transaction with only one connection, your transaction starts on this connection.
If you open a new connection and insert records via it, then it won't be affected by a rollback on the 1st connection.


--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to