Search Postgresql Archives

Connection Pool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Everyone,

I'm trying to work with connection pools. The example I'm looking at is lockated here:

http://www.developer.com/img/2009/11/Listing1_ConnectionPoolClass.html

You will notice that the getConnectionFromPool method does not implement any blocking, and only returns null.

I would like my application to try and get a connection from the pool, and if there are none free, wait until either one is free or time is up.

What is the best way to do this? Would creating a wrapper method work? This wrapper method would check for null, and if so, execute a while loop until a connection is returned. Also, would this wrapper method need to be synchronised (remembering that multiple threads may be trying to get a connection)?

Thanks

Jonny

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux