Jump to content

non-closed SQLite connections


 Share

Recommended Posts

I'm using SQLite with autoit:

#include <SQLite.au3>
#include <SQLite.dll.au3>

_SQLite_Startup()
_SQLite_Open("Gala.db")

$SQL = "SELECT * FROM my_table;"

$result = _SQLite_Exec(-1,$SQL) 
if $result <> 0 then MsgBox(0,"SQL-Error","Can't execute SQL-Statement")

_SQLite_Close()     ; <- But what happens when I can't do it
_SQLite_Shutdown()

e.g. script abort abnormaly:

what happens in that case with non-closed SQLite sessions? :)

Link to comment
Share on other sites

From help-file for dllclose(), as _SQLite_Startup() does a dllopen() with some additional checks...

Upon termination, AutoIt automatically closes any dlls it opened but calling DllClose is still a good idea.

Best Regards

Edited by KaFu
Link to comment
Share on other sites

I'm using SQLite with autoit:

#include <SQLite.au3>
#include <SQLite.dll.au3>

_SQLite_Startup()
_SQLite_Open("Gala.db")

$SQL = "SELECT * FROM my_table;"

$result = _SQLite_Exec(-1,$SQL) 
if $result <> 0 then MsgBox(0,"SQL-Error","Can't execute SQL-Statement")

_SQLite_Close() ; <- But what happens when I can't do it
_SQLite_Shutdown()

e.g. script abort abnormaly:

what happens in that case with non-closed SQLite sessions? :o

It's no big deal. SQLite does not have a server process that hosts "connections". It is based on simple file share with an internal file lock only while actually writing to the DB file. Everything _SQLite_Close() does is internal to your script and does not affect the state of the DB file itself.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...