Re: Allow commit() without transaction?

From: Date: Mon, 12 Apr 2021 12:43:32 +0000
Subject: Re: Allow commit() without transaction?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-114031@lists.php.net to get a copy of this message
On 12-04-2021 14:07, Nikita Popov wrote:
> I believe this behavior is correct, but I could see an argument made in
> favor of always allowing commit() calls (but not rollBack() calls) even if
> there is no active transaction. That would change the meaning of commit()
> from "commit an active transaction" towards "commit if an active
> transaction exists".
> 
> Any opinions on that?
> 

I think it is really nice that commit() throws for inactive
transactions. Code paths that mess up your transactions will not go
unnoticed that easily.

My preference would be to have a separate commit method or a method
parameter to explicitly allow committing without an active transaction.

Regards,
Dik Takken


Thread (6 messages)

« previous php.internals (#114031) next »