Welcome Guest, Not a member yet? Register   Sign In
anyone have similar issue with db locking up when used for CI sessions?
#1

[eluser]Chillahan[/eluser]
Ever since I made one of my models have a transactional insert method which starts a transaction to ensure either three different tables are updated together, or not at all, and have since caused an error where I had manually assigned an id to the auto_increment column of one of the tables (which collided with the next value mySQL wanted to use), I have been sporadically getting this message on any database-querying page:

A Database Error Occurred
Error Number: 1205

Lock wait timeout exceeded; try restarting transaction

DELETE FROM `sessions` WHERE `last_activity` < 1215567527

Do I have to restart mySql every time this happens? Is transaction support in the CI DB class buggy and NOT to be trusted, for this obvious reason?
#2

[eluser]Chillahan[/eluser]
I would like to add - the only "sporadic" nature of this seems to be whenever CI decides it's time to clear some old database sessions out (it doesn't do this every session-based page load).
#3

[eluser]predat0r[/eluser]
[quote author="linnovision" date="1317042556"]Hey I know this post is very old . . . and you might have fixed the issue by now. but just in case it helps anyone else who lands here . .

Ive had the exact same error. . . and after searching on codeigniter forums found that this problem occurs when the pconnect = TRUE in the database config file.

it happened to me since while i was in a transaction, the script encountered a fatal error. as a result the pconnect did not end the transaction.

I was not even able to run the sql

Code:
DELETE FROM `ci_sessions` WHERE `last_activity` < 1317031023

using phpmyadmin. As i was working on my local machine i was able to restart the mysql server and set pconnect = false

everything now works fine.[/quote]

Thank you, solved my problem too




Theme © iAndrew 2016 - Forum software by © MyBB