[Lazarus] Database connection manager

JoshyFun joshyfun at gmail.com
Mon Jan 18 11:13:48 CET 2010


Hello Lazarus-List,

Monday, January 18, 2010, 10:11:05 AM, you wrote:

i> Well lets say I have two forms that can open the same query that is located
i> in a DataModule, now I want to close the connection only when the last form
i> that asked to open it is closed, instead of closing it in each form, a
i> manager will know what opened it, and how many requests to close it, and
i> only when the last request has arrived, it will close the connection.
i> Is there anything existed for it today, or should I create one (and post it
i> here as a new class) ?

I do not know if it is implemented in Lazarus connections, but if you
put "KeepConnected" to false in the connection control, when no
control needs the connection it should be closed. So if you close all
forms that uses queries the connection should be closed, but keep in
mind that if you leave a query, in the module, open the connection
will not be closed.

-- 
Best regards,
 JoshyFun





More information about the Lazarus mailing list