• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

slPushDatabase and slPopDatabase

Started by Bern Ertl, February 09, 2009, 05:44:14 PM

Previous topic - Next topic

Bern Ertl

The slPushDatabase and slPopDatabase functions can use an internal stack that is managed with a GLOBAL string array in the SQLitening DLL.  If there are two applications using the same SQLitening DLL, is the stack shared between the two apps, or does each reference to the DLL get it's own GLOBAL var space?

Also, if I have multiple databases open in remote mode (using the push/pop system), and the client app dies and drops the connection to the server, does the server close all them all?  Is it tracking all the open files too?


Fred Meier

Two or more processes using same dll do NOT share global memory.  Each process has its own global space.

All open SQLite files will be automatically closed when a client connection is dropped or disconnected in any way.

QuoteIs it tracking all the open files too?
Don't know what you mean?

Bern Ertl

Thanks Fred, I was pretty sure that was the case with the GLOBAL vars, but it's been so long since I was really involved in these programming details, I wasn't 100% sure.

Quote from: Fred Meier on February 10, 2009, 02:03:41 PM
QuoteIs it tracking all the open files too?
Don't know what you mean?

As I understand it, when the client app calls slOpen in remote mode, the server opens the database file and returns a handle to the SQLitening DLL.  If I push the handle and open another database, the server will open another database file and return that handle.  The SQLitening DLL (internal stack) or client app is responsible for managing all the open handles.

If the client app crashes, the server application still has all the database files open.  It must be maintaining it's own stack (or other storage structure) to track what files are open and related to a connection in order to close them in this circumstance, correct?

Fred Meier

QuoteIf the client app crashes, the server application still has all the database files open.  It must be maintaining it's own stack (or other storage structure) to track what files are open and related to a connection in order to close them in this circumstance, correct?
Correct, SQLiteningServer tracks all open database handles and will automaticall close then.