Bogdan Stancescu wrote:
I'm developing a library and would need to know if the code calling my
library has already started a MySQL transaction or not. I want to know
whether I should start one or use savepoints instead -- starting a
transaction if one is already in progress commits the existing
transaction, and setting a savepoint silently fails outside
transactions. And I was unable to find any non-destructive way of
retrieving that information -- is there any?
I don't use MySQL, having been embeded with a 'real' database since
before MySQL even thought about transactions ;) but your question does
not make sense from a functional point of view.
The whole point of a transaction is to bundle together a packet of work.
If any part of the packet fails, then it can be rolled back to a known
place. If you are doing a package of work within your library, you would
use your own transaction. If you are processing data for a higher level
function, either that function would pass you the transaction handle, or
IT would handle your return and roll back or carry on as required.
Or am I simply missing something because MySQL still does not ACTUALLY
support real transactions? ( This discussion may be better on the
PHPDatabase list )
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php