Welcome Guest, Not a member yet? Register   Sign In
db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help]

I have had a discussion on the code and application forum between stevefink and kirilisa the results of it show the following:

When db_debug=FALSE in the config/database.php transactions work fine,
when db_debug=TRUE transactions are not completed on some os's and cause strange results or table locks.


line 303 of DB_driver.php will call display_error if db_debug is turned on as soon as a query fails.
line 1143 in the display_error() function is exit; which will terminate the script if db_debug is on and that is maybe why we are seeing different behaviors on different OS’s.

Although rollback/commit appears to work on my machine at home with debug on, it does not on other machines. I'm guessing this could be a race condition between PHP exiting and the commit/rollback happening.

anyway the thread below shows some tests that have been taken.

in my opinion it should be made clear in the documentation that db_debug needs to be set to FALSE for transactions to work OR we don't display the error inside a transaction until its commited or rolled back. kirilisa simply commented out the call to display_error() and the transactions worked again

[eluser]Sam Dark[/eluser]
It is documented http://ellislab.com/codeigniter/user-gui...tions.html , Managing Errors section.

It justs says to turn db_debug off when you want to display your own errors.... It does not mention that transactions will/may not commit or rollback if db_debug is set to TRUE.

I am mentioning it as this has caused a few people problems on the forums, and it also doesn't give confidence in the code to a newbie using transactions as they often test with an out of box solution which has db_debug on.

[eluser]Sam Dark[/eluser]
Well, yes. Agree.

I will create a bug report then, thanks for the reply


I bumped the bug report but I'll bump this thread also in case the user guide gets monitored separately some how.

Theme © iAndrew 2016 - Forum software by © MyBB