Too many active connections

Hi,

In our web-client we have abouth 20 different databaseservers which we use. All of these have Active Connections 0/30 as setting.
Now with one databaseserver we have problems that the active connections aren’t released.
So we are getting ‘com.servoy.j2db.dataprocessing.DataException: Cannot get a connection, pool error Timeout waiting for idle object’ on this databaseserver continuously.
With all the other databaseservers we don’t have these problems.

What could be a problem with this databaseserver, that the active connections aren’t released? (Network problems of some sort maybe?)

Current stacktrace is attached: with active connections = 30/30 on that server.

stacktrace.txt (284 KB)

Hi Jos,

It looks like there are lock(s) not released.
Are you using database transactions on that connection ?

We are using the same code as on all of the other databaseservers.
In the sql-servers we use transactions.

Hi Jos,

And in the Servoy-admin page do you see transactions/locks ?

No,

both the transaction and locks pages are empty.

Hi Jos,

Do you see any waiting transactions in the database server itself?

No, we can’t see anything hanging in the database server.
So that’s just the weird thing, no visible signs where the problem is.

3th party plugins that are using connections and don’t release them?

Well, we use plugins from it2be.

But I suppose, if this should be the problem, we also should have it with the other databaseservers.

more users? some kind of different code for those users?

Form servoy’s point of view there is no different between 1 server or the other. So somehow something must hold on to those connections and don’t release them

Well, code is the same for all servers.

But will something in servoy will hold on that connection?
Or can it be that there is no reaction or feedback at some point from the databaseserver, that servoy is waiting for that?

i looked a bit closer to the stackdump again.

And what i see there i kind of seen before, what happens is that 29 requests are trying to borrow and connection.
They are all waiting on 1 thread that also is in the borrow of the connection. (so it is not doing the actual query)
and that 1 thread/connection is executing the validation query, and just waits on that, What kind of validation query do you have there?
Can it be that that queries a table that can have locks or transactions???

You mean this validation query, like in the database server setting:

yes it is waiting for the validation query:

Thread: pool-10-thread-418, state: RUNNABLE, total cpu time: 5609.375ms, total user time: 4937.5ms
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(Unknown Source)
java.io.DataInputStream.readFully(Unknown Source)
java.io.DataInputStream.readFully(Unknown Source)
net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:814)
net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:695)
net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:443)
net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:102)
net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:87)
net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3772)
net.sourceforge.jtds.jdbc.TdsCore.setRowCountAndTextSize(TdsCore.java:3741)
net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:946)
net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:360)
net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1176)
sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.servoy.j2db.Za.Za.Zf.invoke(Zf.java:5)
$Proxy8.executeQuery(Unknown Source)
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
com.servoy.j2db.Za.Za.Zl.Za(Zl.java:8)
com.servoy.j2db.Za.Za.Zo.validateObject(Zo.java:19)
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:833)

so the only thing i can say is check at that moment the database and look what connections are there live at the moment and what they are doing
Servoy jus waits for that query to return.

We restarted the server, so currently it is back to normal. But we’ll check the activity at the databaseserver again, when it happens again.

The query is ‘select 1’. It couldn’t be waiting for much?