![]() |
db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] (/showthread.php?tid=7744) |
db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 04-21-2008 [eluser]gtech[/eluser] 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. why? 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. [url="http://ellislab.com/forums/viewthread/77294/"]http://ellislab.com/forums/viewthread/77294/[/url] solution 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 db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 04-21-2008 [eluser]Sam Dark[/eluser] It is documented http://ellislab.com/codeigniter/user-guide/database/transactions.html , Managing Errors section. db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 04-21-2008 [eluser]gtech[/eluser] 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. db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 04-22-2008 [eluser]Sam Dark[/eluser] Well, yes. Agree. db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 04-22-2008 [eluser]gtech[/eluser] I will create a bug report then, thanks for the reply [url="http://codeigniter.com/bug_tracker/bug/4451/"]http://codeigniter.com/bug_tracker/bug/4451/[/url] db_debug=TRUE will cause transactions to not rollback or commit. [this is not documented in help] - El Forum - 01-09-2009 [eluser]a&w[/eluser] I bumped the bug report but I'll bump this thread also in case the user guide gets monitored separately some how. |