Page 1 of 1

DisconnectedMode & Pooling

Posted: Fri 21 Feb 2014 15:27
by cooler
Hello again,

I'm trying to connect to PostgreSQL with DisconnectedMode and Pooling. Without success :cry:
Can anyone tell me what I'm doing wrong?

I created this simple application to test the Pooling:
A simple form with three buttons. After pressing the first one, this code retrieves the data from the first table:

Code: Select all

if (utTable1->Active)
	utTable1->Close();
utTable1->Open();
When you press the second, the code retrieves the data from the second table:

Code: Select all

if (utTable2->Active)
	utTable2->Close();
utTable2->Open();
And likewise for the third table.

TUniConnection connects to and disconnects from the database when you press any of these buttons.
The following log comes from dbMonitor:

Code: Select all

  2014-02-21 16:19:47 n/a UniDAC monitoring is started Complete
  2014-02-21 16:19:49 0,140 Connect: postgres@localhost Complete
  2014-02-21 16:19:49 0,625 SQL Execute: SELECT * FROM table1 Complete
  2014-02-21 16:19:50 0,000 Disconnect: postgres@localhost Complete
  2014-02-21 16:19:53 0,000 Connect: postgres@localhost Complete
  2014-02-21 16:19:53 0,016 SQL Execute: SELECT * FROM table2 Complete
  2014-02-21 16:19:53 0,000 Disconnect: postgres@localhost Complete
  2014-02-21 16:19:55 0,016 Connect: postgres@localhost Complete
  2014-02-21 16:19:55 0,000 SQL Execute: SELECT * FROM table3 Complete
  2014-02-21 16:19:55 0,000 Disconnect: postgres@localhost Complete
  2014-02-21 16:20:00 n/a UniDAC monitoring is finished Complete
Why TUniConnection hangs up immediately after downloading the data?

Configuration:
One TUniConnection, with the following options:

Code: Select all

DisconnectedMode = true;
Pooling = true;
TPoolingOptions->ConnectionLifetime = 30000;
TPoolingOptions->MaxPoolSize = 100;
TPoolingOptions->MinPoolSize = 5;
TPoolingOptions->Validate = true;
And three similar TUniTable with such options:

Code: Select all

CachedUpdates = true;
TableName = table1; (2 and 3 for the two other)

SQL is "SELECT * FROM table1" (2 and 3).
Thanks in advance and sorry for my language ;)
-----
c++ Builder XE2 update 4
UniDAC 4.1.6

Re: DisconnectedMode & Pooling

Posted: Mon 24 Feb 2014 09:35
by AlexP
Hello,

DisconnectedMode is designed for work with unstable connection, therefore connection is open for only sending/retrieving data to/from server. After data is retrieved, connection closes.