logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Something I noticed with SQLITE when I was porting code.

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Tenkawa



Joined: 25 Aug 2005
Posts: 15

PostPosted: Wed Sep 14, 2005 18:39    Post subject: Something I noticed with SQLITE when I was porting code. Reply with quote

Am I mistaken or is the SQLITE routine in the Windows NWNX doing the following.


Open File
Run all transactions until nwserver closes
Commit transactions to DB.
Close file

It seems to me that using this method is kind of a waste. The way I wrote it auto commits every transaction. Unless you commit the transaction another DB reader cannot see the changes made during the writer's session.

I may be wrong but I don't see a 'COMMIT' till the disconnect function.

Tenkawa
Back to top
View user's profile Send private message
Primogenitor



Joined: 08 Jan 2005
Posts: 88

PostPosted: Thu Sep 15, 2005 11:57    Post subject: Reply with quote

Nope thats the way it works. SQLite is much quicker than MySQL inside a transaction, because its mainly in memory rather than on disk. You can manually issue COMMIT and BEGIN commands to manage your own transactions. If your autocommitting each SQL command, then that can be more inefficient if you are running the same command every heartbeat for every player (location tracking for example) rather than just using a transaction to put all the data in the DB in one go.
Back to top
View user's profile Send private message
Tenkawa



Joined: 25 Aug 2005
Posts: 15

PostPosted: Thu Sep 15, 2005 13:59    Post subject: Reply with quote

ok I see. You are leaving the begin and commit if desired up to the users and only forcing a commit once to make sure nothing is left out there. With a serisl process such as nwserver I doubt there will be much performance loss doing auto commits though. That explains why I saw that though thanks.

Tenkawa
Back to top
View user's profile Send private message
Primogenitor



Joined: 08 Jan 2005
Posts: 88

PostPosted: Thu Sep 15, 2005 16:55    Post subject: Reply with quote

There is some speed data here: http://www.nwnx.org/index.php?id=doc_odbc2#V Basically, with no transactions at all, which I think is the equivalent to starting and stopping a transaction for every SQL command, SQLite slows down by almost a factor of x100.
Back to top
View user's profile Send private message
Tenkawa



Joined: 25 Aug 2005
Posts: 15

PostPosted: Thu Sep 15, 2005 17:01    Post subject: Reply with quote

Nod. I see.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group