Subject Web Apps - cache lost when db disconnects
Author Jeff Dunlap
I am using Firebird 2.0.3 running on a Windows 2003 Web Ed.  It has worked very reliably but I've had to experiment with workarounds in order to keep my database cached after disconnecting from it.

The performance hit (due to lost db cache) is easily overcome simply by LEAVING THE DATABASE OPEN but I've been told that keeping it open indefinately is not a good idea for FB.  I've noticed that even if a secondary application has the database open, the cache is not lost.

Users on the IBPP newsgroup mentioned that they have not observed this loss of buffering, but they run Firebird on non Windows OSs.  On Windows, it is definately lost the moment you disconnect from the database.

Here is my working SQL code (using the IBPP library):

    db = IBPP::DatabaseFactory("", DbName, UserName, Password);
    tr = IBPP::TransactionFactory(db);
    st = IBPP::StatementFactory(db, tr);
    db->Disconnect(); // buffering wiped out

Users of the IBPP newsgroup suggested creating a database connection pool for my web app but this seems like an extra headache.

My 'hodgepodge' workaround has been to keep a single 'dummy' instance of the database open for several hours doing nothing.  This keeps the database buffered.  I close and reopen this 'dummy' instance every 4 hours so that FB can do it's housekeeping (or whatever it has to do). 

Doing this allows the database to stay buffered while other instances (using the connect/disconnect code above) do the actual db work.

Is there anything in newer versions of FB (or in the works) to allow FB to buffer the database for a period of time after applications disconnect from them?

Thank you very much,


[Non-text portions of this message have been removed]