0
votes

Hey I'm using Glassfish open source v4 and I'm having a weird problem.

I have defined a JDBC connection pool to Oracle 11g in the admin console and I've set :

Pool Settings

Initial and Minimum Pool Size: 500

Maximum Pool Size: 1000

Pool Resize Quantity: : 750

And I've created a specific user for this connection pool. Yet sometimes when I inspect opened connections in the database I see that there are more then 1000 (maximum I've seen was 1440)

When this happens any query attempts fail, sometimes with OutOfMemory exception, some show http thread interuptions and some don't show any logs at all, just takes a long time.

What I am wondering is how is it possible the Glassfish opens more connections then I've defined it to?

1
How are you counting the open connections on the database side?Alex Poole
@AlexPoole Yes, that's where i see 1400eric.itzhak
Select machine,username,count(*) from gv$session group by machine,username order by count(*)eric.itzhak

1 Answers

0
votes

1t try to compare output from netstat on appl. server and db server side. You may have some "dangling" connections. Also try to find some documentation about DCD (Dead connection detection) in Oracle.

Few years ago I saw situations where Java application server thought that the connection is dead because it is not responding for few minutes. So this connection was put onto some dead connection list and a new connection was created.

There also can be some network issues - for example there is a FW between appl and db server. When TCP connection is not active for one hour then it's cut over on one side but DB sever does not know about that.

The usual way how to investigate that is

  • compare output of both netstat(s) (appl./db)
  • identify dangling TCP connections
  • translate TCP connection onto Unix process id(PID) of Oracle session process
  • translate PID onto Oracle session (SID and SERIAL#)
  • kill the session on Oracle level (alter system kill session ...)