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

[eluser]stevefink[/eluser]
Hi all,

I'm using the database class provided by CI as well as its transaction support. I've run into a serious issue which is detrimental to my sites health until I can figure out how to avoid/remedy it in the future.

I have a simple insert query nested between:

$this->db->trans_start();

and

$this->db->trans_complete();

One seriously impeding issue is a problem with one of my algorithms which should be checking for duplicates on columns which do not allow for such data. With that said, the transaction hierarchy is not forgiving in the sense where if I try to insert a row with a duplicate key -- kind of defeating the purpose of atomic commits.

In the initial run, I make an HTTP request and see the following:

ERROR - 2008-04-19 17:44:45 --> Query error: Duplicate entry '8388607' for key 2

All subsequent requests from here forward fail, and the site is rendered useless until I manually restart MySQL as I have no reference to the transaction:

ERROR - 2008-04-19 17:46:46 --> Query error: Lock wait timeout exceeded; try restarting transaction

Have any of you folks experienced something similar?


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