Welcome Guest, Not a member yet? Register   Sign In
Re Enable Transactions after using trans_off()
#8

(10-23-2016, 08:20 AM)daveĀ friend Wrote: The Enabling Transactions section begins with

Quote:Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you can do so using $this->db->trans_off():

which is followed immediately by this example code.

PHP Code:
$this->db->trans_off();

$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->trans_complete(); 

And you don't think that this example suggests, implies or otherwise demonstrates that transactions will be resumed after the call to trans_off()? That has to be because of your intimate knowledge of the source code. Without that knowledge and within the context of "Enabling Transactions" I don't see how the example can be interpreted in any way other than a demonstration of trans_start() as being the opposite of trans_off().

If the point of the example is to explain that the call $this->db->query('AN SQL QUERY...'); will not be handled as a transaction then that needs to be explicitly stated. The fact that
Quote:"disable" doesn't just mean "stop" or "end", it means you're not allowed to do it.
needs to be explained as does the fact that neither trans_start() or trans_begin() will reverse that state.

I argree that this sentence is confusing:

Quote:Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you can do so using $this->db->trans_off():

It is wrong in at least 2 ways.

But the example itself is in no way incorrect, and you did only talk about the example up until now. There's nothing wrong or misleading in the example itself.
Reply


Messages In This Thread
RE: Re Enable Transactions after using trans_off() - by Narf - 10-24-2016, 12:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB