Welcome Guest, Not a member yet? Register   Sign In
Code Igniter database transactions
#12

[eluser]gtech[/eluser]
OK,

my db defaults to innodb so excuse the table create example.

I have to say that running my test on windoze XP I do not see the same behavior, with db_debug set to TRUE my db table continually rolls back after every refresh.. but reading the code I am expecting it to fail..

line 303 of DB_driver.php will call display_error if db_debug is turned on
line 1143 of DB_driver.php is exit; which will terminate the script if db_debug is on and that is maybe why we are seeing different behaviours on different OS's.

but from what you are saying kirilisa is that when db_debug is FALSE it works as expected.

I think then the documentation should say that transactions only work if db_debug is set to FALSE
OR
this is a bug/feature request: don't display the error if its in a transaction.

If it makes you feel better kirilisa I have 25 db tables with about 10 different functions for each table, and about 50% of those are in transactions (the ones with multiple updates/inserts). I have written automated tests for all of these functions and they test rollback by inserting rouge values I then select the data back out of the db to test it.. with db_debug set to FALSE all my test run passed. with db_debug set to TRUE it will obviously halt at the first error. I have tested this with WINDOWSXP, SUSE & UBUNTU LINUX and have had no problems with db_debug set to FALSE, and using 1.4 - 1.6 of CI, and each model is tested within one request (about 100 tests within each request).

stevefink - can you let us know if setting db_debug to FALSE fixes your problem, if so then I can/you can/anyone can open a thread in the bugs forum linking to this thread


Messages In This Thread
Code Igniter database transactions - by El Forum - 04-19-2008, 03:58 PM
Code Igniter database transactions - by El Forum - 04-19-2008, 07:48 PM
Code Igniter database transactions - by El Forum - 04-19-2008, 11:02 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 03:15 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 03:46 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 04:07 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 04:42 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 06:07 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 06:17 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 07:20 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 07:36 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 08:27 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 08:45 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 09:00 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 10:07 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 10:12 PM
Code Igniter database transactions - by El Forum - 04-20-2008, 10:30 PM
Code Igniter database transactions - by El Forum - 04-21-2008, 12:36 PM
Code Igniter database transactions - by El Forum - 04-21-2008, 03:56 PM
Code Igniter database transactions - by El Forum - 04-21-2008, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB