Re: MySQL -- finding whether there's a transaction started

From: Date: Mon, 27 Apr 2009 05:49:24 +0000
Subject: Re: MySQL -- finding whether there's a transaction started
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-292008@lists.php.net to get a copy of this message
Bogdan Stancescu wrote:
Hello list, 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

« previous php.general (#292008) next »