[TYPO3-dev] Idea: add transaction support to t3lib_db

Dmitry Dulepov dmitry.dulepov at gmail.com
Mon Mar 7 15:34:14 CET 2011


Hi!

Christian Futterlieb wrote:
> Is it really good coding style to wrap as much code as possible with
> transactions under the flag of data consistency? I don't think so. I mean:
> 1. a calling script could commit its transaction before calling a hook
> (and guarantee the integrity of the passed data therefore) see below
> 'Instead of'.

TCEmain does not work like this :) Also it would not work at all with 
script that need multiple TCEmain calls to be consistent (and also changes 
from hooks to be consistent).

> 2. a calling/called script should be able to check wether a transaction
> has been started or not

Not possible with modern databases.

> 3. a called script must not be essential for the calling script, but
> could break it's data saving (Ex: when I add a custom field to a
> fe_users record and fill it via hook, I could never change the username
> when the custom field saving fails).

That's exactly why everybody uses nested transactions: to separate 
knowledge about transactions in various scripts.

-- 
Dmitry Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/




More information about the TYPO3-dev mailing list