Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-03

KeepConnection behaviour

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Kapibara Pas

If KeepConnection is false, shouldn't the connection close automatically when all querys are closed?

  Conn.KeepConnection:=False;
  Query.Close;
  //Test connection:
  if Conn.Connected then
    MessageDlg('Bug?', 'Query closed, but connection still open!', mtInformation, [mbOK], 0);

Maybe I'm missing something, but it doesn't seem to happen. I used a TSQLite3Connection. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140321/71fa586a/attachment.html>

kapibara
to Reinier Olislagers

Okey, its not implemented. Thanks for your answer.

Anyway, here's my 2 cents:

I understood KeepConnection (false) as a way to provide matching behaviour between Open and Close of the Query.
Query.Open opens its connection automatically and if Query.Close was implemented, it would then close its connection. Provided no other query was using the connection.

Reinier Olislagers wrote 14 lines
On 21/03/2014 16:34, Kapibara Pas wrote: > If KeepConnection is false, shouldn't the connection close automatically > when all querys are closed? See the help for FPC 2.6.4: http://www.freepascal.org/docs-html/fcl/sqldb/tsqlconnection.keepconnection.html "KeepConnection can be used to attempt to keep the connection open once it is established. This property is currently not implemented." -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
kapibara
to kapibara

Sorry, I of course meant that KeepConnection (false) would make a call to Query.Close drop the connection.

"...if Query.Close was implemented, it would then close its connection."