![]() |
SQLite Rollback
When I restarted Era's NPC-server last night, the SQLite database seemed to roll back, causing a few problems, and a ton of people to get unjailed who were previously unjailed (it's searching WHERE release_on < timevar2).
Why did this happen, and how can we prevent it? |
Hope someone could shed some light on this, because it kinda makes me reconsider using it to store player and item data.
|
Quote:
|
Are you starting and committing your transactions?
|
Quote:
I'm not opening any elsewhere. |
I don't know, but in MYSQL you have to always start and end it
|
Quote:
|
Perhaps it's a problem with the timevar2 value? You should run some debug tests to isolate the problem (set up a similar test database where you track different actions and restart the server and see how that affects your database).
|
Quote:
|
For now I will add a system to automatically back up the SQLite database every hour or so, and have it automatically update the file on server restart, but this definitely needs to be fixed before we can start using it for more important things (bank accounts, for example).
|
Hope we can get Stefan to shed some light on this situation.
|
Hmmm normally it should update the database file each time you insert, modify or delete data. We have disabled file locking because only one npcserver is accessing the database file at a time, and also because file-locking is not working with several file systems that we use. But may be that is causing problems with data not written back to the file, only kept in memory or so. Normally that can easily be checked by downloading the file and opening it with some sqlite database editor.
|
Quote:
Quote:
http://www.sqlite.org/lang_transaction.html http://www.sqlite.org/speed.html I suggest you read those. |
All times are GMT +2. The time now is 04:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.