CommandHelper

CommandHelper

46.5k Downloads

SQLite with multiple servers causes errors.

LadyCailinBot opened this issue ยท 4 comments

commented

CMDHELPER-2900 - Reported by LadyCailin

All statements cause a SQLITE_BUSY error.

After researching, what I can do is try to obtain an EXCLUSIVE lock, using BEGIN EXCLUSIVE TRANSACTION in a loop, with random small delays until it succeeds. Once it succeeds, then the remaining queries will work as is.

Additionally, it appears as though the startTransaction method isn't used in DataSource. This shouldn't be the case, either this is dead code, or something isn't working correctly, so that should be investigated as well.

commented

Comment by PseudoKnight

Not sure if this should be posted in this issue, but the latest builds seem to be causing server freezes on compiling sometimes due to the recent changes in SQLite.
http://paste.thezomg.com/12962/13914842/

I have a couple clear_value() in main.ms.

commented

Comment by LadyCailin

Yes, this is useful information. With the new format I have, if the database is busy, it retries, currently indefinitely. That may be a horrid assumption that the database will free up soon, but I need to get to the root of the cause of the SQLITE_BUSY issues. I'm still not 100% sure what changed.. I put the code back to how I had it before (not exactly, but it's no longer recycling connections), and it didn't fix it, so I'm somewhat at a loss as to what to do right now. I need to research SQLite more, and hopefully I can come to a solution soon.

The bug is very high priority, however.

commented

Comment by LadyCailin

@PseudoKnight, do you have multiple servers using the same database file?

commented

Comment by LadyCailin

Ok, nevermind. I figured it out. The problem was that I had an accidental infinite loop in clear_value.