• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't get trans_status() to work

#1
[eluser]dcallan[/eluser]
Hi there, for some reason I can't seem to get the below to work at all.

if ($this->db->trans_status() === FALSE)

I tried === true, === false, == true, === false and it didn't enter the block at all.

I'm using sqlsrv driver a member on here made available with CI 1.7
I seen someone posted a thread about this a while back but there was no resolution.

Could it be to do with the driver or might it be an internal CI thing.

Thanks in advance.

#2
[eluser]Unknown[/eluser]
waiting ans

#3
[eluser]InsiteFX[/eluser]
Strict Mode

By default CodeIgniter runs all transactions in Strict Mode. When strict mode is enabled, if you are running multiple groups of transactions, if one group fails all groups will be rolled back. If strict mode is disabled, each group is treated independently, meaning a failure of one group will not affect any others.

Strict Mode can be disabled as follows:
Code:
$this->db->trans_strict(FALSE);

InsiteFX

#4
[eluser]dcallan[/eluser]
I only have one transaction in this case. I open it and commit it the standard way. The db records are rolled back when my second sub query fails, so the actual underlying transaction is working correctly. but I wanted to write to a log if the transaction failed.

tonson99 are you having this same issue?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.