View previous topic :: View next topic |
Author |
Message |
wendel1978
Joined: 21 Apr 2005 Posts: 5
|
Posted: Thu Aug 18, 2005 4:19 Post subject: Issuing a COMMIT (SQLite) |
|
|
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 |
|
|
Primogenitor
Joined: 08 Jan 2005 Posts: 88
|
Posted: Thu Aug 18, 2005 9:07 Post subject: |
|
|
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 |
|
|
wendel1978
Joined: 21 Apr 2005 Posts: 5
|
Posted: Thu Aug 18, 2005 15:34 Post subject: |
|
|
Thanks primo! I appreciate this. |
|
Back to top |
|
|
|