Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-27-2009, 09:43 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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?
__________________
Reply With Quote
  #2  
Old 05-28-2009, 04:46 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hope someone could shed some light on this, because it kinda makes me reconsider using it to store player and item data.
__________________
Quote:
Reply With Quote
  #3  
Old 05-28-2009, 04:48 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by fowlplay4 View Post
Hope someone could shed some light on this, because it kinda makes me reconsider using it to store player and item data.
Indeed, I was thinking the same thing. We store use SQL to store bank accounts on Era Dev, and this of course has to be completely flawless.
__________________
Reply With Quote
  #4  
Old 05-28-2009, 06:23 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Are you starting and committing your transactions?
__________________
Reply With Quote
  #5  
Old 05-28-2009, 06:29 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
Are you starting and committing your transactions?
I thought that using a requestsql(query, true) would automatically open then close a transaction, no?

I'm not opening any elsewhere.
__________________
Reply With Quote
  #6  
Old 05-28-2009, 11:35 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
I don't know, but in MYSQL you have to always start and end it
Reply With Quote
  #7  
Old 05-28-2009, 05:29 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by http://www.sqlite.org/lang_transaction.html
No changes can be made to the database except within a transaction. Any command that changes the database (basically, any SQL command other than SELECT) will automatically start a transaction if one is not already in effect. Automatically started transactions are committed when the last query finishes.
Would make believe that it begins, and commits automatically.
__________________
Quote:
Reply With Quote
  #8  
Old 05-28-2009, 05:53 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
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).
Reply With Quote
  #9  
Old 05-28-2009, 08:04 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Gambet View Post
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).
No, because I have a system dealing with a 10 column table, but after the restart, the database rolled back to when the table only had 9 colums (I added a value) and was causing all kinds of problems. It was definitely a rollback and not just the jail system that experienced the problem.
Reply With Quote
  #10  
Old 05-28-2009, 11:17 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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).
__________________
Reply With Quote
  #11  
Old 05-30-2009, 10:06 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hope we can get Stefan to shed some light on this situation.
__________________
Quote:
Reply With Quote
  #12  
Old 05-31-2009, 12:47 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #13  
Old 05-31-2009, 12:59 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by fowlplay4 View Post
Would make believe that it begins, and commits automatically.
Quote:
Originally Posted by cbk1994 View Post
I thought that using a requestsql(query, true) would automatically open then close a transaction, no?

I'm not opening any elsewhere.
Maybe you people should learn how SQLite works before you start complaining about it on the forums.

http://www.sqlite.org/lang_transaction.html
http://www.sqlite.org/speed.html

I suggest you read those.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.