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 
 
Issuing a COMMIT (SQLite)

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
wendel1978



Joined: 21 Apr 2005
Posts: 5

PostPosted: Thu Aug 18, 2005 4:19    Post subject: Issuing a COMMIT (SQLite) Reply with quote

Hello all.

I am trying to set up the db for my server... However, I'd like to add the commit to the loop so I can access the db concurrently.

I did a search here in the forums, and read that there's an issue whereby if you don't occasionally issue a commit you lose data on a crash.

I was wondering if this was still an issue, and if someone could tell me how to add a commit to fix it.

Thanks!
W
Back to top
View user's profile Send private message
Primogenitor



Joined: 08 Jan 2005
Posts: 88

PostPosted: Thu Aug 18, 2005 9:07    Post subject: Reply with quote

This code will end one transation and start a new one.
Code:
SQLExecDirect("COMMIT; BEGIN;");

If you put it in the module HB, it will run every 6 seconds. Alternativly, put it in a pseudoHB started in module load like this:
Code:
void DoTransac();
void DoTransac()
{
    SQLExecDirect("COMMIT; BEGIN;");
    DelayCommand(15.0, DoTransac());
}
//then inside void main()
    DoTransac();
Back to top
View user's profile Send private message
wendel1978



Joined: 21 Apr 2005
Posts: 5

PostPosted: Thu Aug 18, 2005 15:34    Post subject: Reply with quote

Thanks primo! I appreciate this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related 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