server hung when fetching connection from pool

Hi,I’m a newer in tamino development. We’re making use of tamino poolmanager to get DB connection. But we found after some time, server hung when trying to fetch connection from the pool.The only solution is to restart the server, but you know in a product environment it’s impossible.
Our cod snippet is as follows:
if(_poolManager == null)
_poolManager = TConnectionPoolManager.getInstance();
if(_poolManager.hasPool(POOL_NAME))
{
System.out.println(“getting connection from pool:”+_poolManager);
_connection = _poolManager.getConnection(POOL_NAME);
System.out.println(“Done:got connection from pool:”+_connection);
}

While the log is as follows:
getting connection from pool:Connection Pool:System, Total connections:9, Available:14, Checked-out:-5

[07/ 7?/2002 09:58:36:4] info: --------------------------------------
[07/ 7?/2002 09:58:36:4] info: action: Processing a GET for /DiskLogon
[07/ 7?/2002 09:58:36:4] info: --------------------------------------
[07/ 7?/2002 09:58:36:4] info: --------------------------------------
[07/ 7?/2002 09:58:36:4] info: action: Looking for Action instance for class cn.edu.gxeea.action.system.DiskLogonAction
[07/ 7?/2002 09:58:36:4] info: --------------------------------------
Warning: No user information is stored in the session
getting connection from pool:Connection Pool:System, Total connections:9, Available:14, Checked-out:-5

[07/ 7?/2002 09:58:49:2] info: --------------------------------------
[07/ 7?/2002 09:58:49:2] info: action: Processing a POST for /logon
[07/ 7?/2002 09:58:49:2] info: --------------------------------------
[07/ 7?/2002 09:58:49:2] info: --------------------------------------
[07/ 7?/2002 09:58:49:2] info: action: Looking for Action instance for class cn.edu.gxeea.action.system.LogonAction
[07/ 7?/2002 09:58:49:2] info: --------------------------------------
Warning: No user information is stored in the session
getting connection from pool:Connection Pool:System, Total connections:9, Available:14, Checked-out:-5

The normal log should be like these:
07/ 7?/2002 09:53:50:0] info: action: Looking for Action instance for class cn.edu.gxeea.action.system.LogonAction
[07/ 7?/2002 09:53:50:0] info: --------------------------------------
getting connection from pool:Connection Pool:System, Total connections:10, Available:14, Checked-out:-4

Done:got connection from pool:com.softwareag.tamino.db.API.connection.TConnectionWrapper@7115ce

What is the value for in your ManagedConnectionPools.xml file? As I understand it, this is how long you will wait for a connection timeout if anything prevents the creation of a new connection. If I set the following values in ManagedConnectionPools.xml: …

1
2
10

… I can create two connections, then my third connection attempt gets an exception “javax.servlet.ServletException: getting a connection timed-out” after 10 seconds. So it seems to work as expected.

Also, are you closing connections when you have finished with them?

[This message was edited by Bill Leeney on 09 Jul 2002 at 16:52.]

Thanks for your reply. And In our configuration file the timeout is very large:100000. So according to your explaination, I think Tamino API is trying to get connection from DB instead of server hung.
But I noticed that the checked-out connection num is minus. Are there any wrong with it?
And why can’t we get connection while there are still have free connections in pool?
BTW: our DB configuration allows for 2000 sessions,so I think it’s pretty easy for the API to get connection.
If convenience, could you please tell me how can I monitor the DB performance, such as where can I enable the log and watch what’s happening while the server seems hung?
Thanks in advance!

I don’t know why the checked-out field is negative, but if you take a typical message from your output:
Total connections:10, Available:14, Checked-out:-4
and you subtract the (-ve) Checked-out from the Total you always get the Available number, (and hence there are no more available). Coincidence perhaps - maybe a developer could comment?

If your database allows 2000 connections why not allow the API to use them with
2000
in ManagedConnectionPools.xml?

I think your questions on database performance and logging are probably better posted elsewhere as they are not really API-related.

Thanks.