iamtheiam
asked on
DB2 ERRORCODE=-4499, SQLSTATE=08001
This error is generated randomly, based on the number of applications running. If I start up 25 applications, they run creat. If I open up 10 applications they run great. If I try to open anothe application an hour later, this message is generated.
Tue Jun 30 14:36:35 EDT 2009 DRIVERFOUND.
Tue Jun 30 14:36:35 EDT 2009 Connecting to database URL = jdbc:db2://10.20.1.125
:50000/EdiMain
a1.1com.ibm.db2.jcc.DB2Dri ver@5ac072
Tue Jun 30 14:36:35 EDT 2009 Failed to connect, reason :
com.ibm.db2.jcc.a.pm: [jcc][t4][2043][11550][4.0 .100] Exception java.net.BindExc
eption: Error opening socket to server /10.20.1.125 on port 50,000 with message:
Address already in use: connect. ERRORCODE=-4499, SQLSTATE=08001
java.lang.NullPointerExcep tion
at edi2.EDIMain.mycarrierAppS tart(EDIMa in.java:47 2)
at edi2.EDIMain.carrierAppSta rt(EDIMain .java:293)
at ANTHEMBCBSMO.ANTHEMBCBSMOM ain.main(A NTHEMBCBSM OMain.java :38)
Exceptionnull
Job is terminated :
Exception in thread "main" java.lang.NullPointerExcep tion
at java.io.DataOutputStream.w riteBytes( Unknown Source)
at edi2.JobDetails.fileOutput Stream(Job Details.ja va:99)
at edi2.JobDetails.appendToFi le(JobDeta ils.java:9 1)
at edi2.EDIMain.carrierAppSta rt(EDIMain .java:328)
at ANTHEMBCBSMO.ANTHEMBCBSMOM ain.main(A NTHEMBCBSM OMain.java :38)
Tue Jun 30 14:36:35 EDT 2009 DRIVERFOUND.
Tue Jun 30 14:36:35 EDT 2009 Connecting to database URL = jdbc:db2://10.20.1.125
:50000/EdiMain
a1.1com.ibm.db2.jcc.DB2Dri
Tue Jun 30 14:36:35 EDT 2009 Failed to connect, reason :
com.ibm.db2.jcc.a.pm: [jcc][t4][2043][11550][4.0
eption: Error opening socket to server /10.20.1.125 on port 50,000 with message:
Address already in use: connect. ERRORCODE=-4499, SQLSTATE=08001
java.lang.NullPointerExcep
at edi2.EDIMain.mycarrierAppS
at edi2.EDIMain.carrierAppSta
at ANTHEMBCBSMO.ANTHEMBCBSMOM
Exceptionnull
Job is terminated :
Exception in thread "main" java.lang.NullPointerExcep
at java.io.DataOutputStream.w
at edi2.JobDetails.fileOutput
at edi2.JobDetails.appendToFi
at edi2.EDIMain.carrierAppSta
at ANTHEMBCBSMO.ANTHEMBCBSMOM
are you releasing the connections once your done with them?
Hi,
It seesm to me that you're using connection pooling and the applicationc leave DB connections open. So that your DB2 driver is connected to the database.
You can use netstat -an to see if there are any connections to the port 50000 of the hoswt with the IP address of 10.20.1.125.
On what platform you're running this application ?
It seesm to me that you're using connection pooling and the applicationc leave DB connections open. So that your DB2 driver is connected to the database.
You can use netstat -an to see if there are any connections to the port 50000 of the hoswt with the IP address of 10.20.1.125.
On what platform you're running this application ?
ASKER
the connections "Should" be released when we are done with them. I am running XP SP3.
Netstat -a -n reveals that I have 204 TCP connections to port 50000
Netstat -a -n reveals that I have 204 TCP connections to port 50000
How are you connected to the DB?= are you connecting directly or are you using something like Hibernate? Because it seems that you ghave some connection pooling mechanism. If ths is the case edit the .war / .aer to limit connections to say 5 for each system so that you will have room for additional applications.
Hi iamtheiam,
A connection isn't really a wire with a switch on yet. Just because the program ends doesn't mean that the driver and/or server knows that the program has ended and that the connection should be terminated.
Make sure that your application does a connection.close() when it ends.
You can also check the connections on the DB2 side with the command:
db2 list applications
Good Luck,
Kent
A connection isn't really a wire with a switch on yet. Just because the program ends doesn't mean that the driver and/or server knows that the program has ended and that the connection should be terminated.
Make sure that your application does a connection.close() when it ends.
You can also check the connections on the DB2 side with the command:
db2 list applications
Good Luck,
Kent
ASKER
Tried running db2 list applications and received a message saying the the maximum number of client applications has been exceeded. I ran the configuration advisor for the DB and requested 400 local connections and 100 remote connections. Applied t he changes and restarted db2. Max Agents went from 200 to 509 along with some other configuration changes. Let's see what happens.
Hi iamtheiam,
That sounds like a temporary 'fix'. You're increasing the number of connections, but if the connection from the driver isn't being dropped, all you're really doing is delaying the inevitable.
But if it buys you some time, great!
Kent
That sounds like a temporary 'fix'. You're increasing the number of connections, but if the connection from the driver isn't being dropped, all you're really doing is delaying the inevitable.
But if it buys you some time, great!
Kent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the # of connections has not increasing past 238. As the apps go through the process, the number of connections are flexing as needed. At this time we are going to go through and see why we have 27 applications running, but 200+ db2 connections. We have 2 DB's that are constantly being connected to. What code I have looked at we are closing the connection when finished.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
We do have some code that connects to DB using Hibernate. This may be the reason. The hibernate piece was developed by a third party. I will investigate.
ASKER
I split the points between Kdo and Keremf. We are going to make sure that the close statements are reachable and adjust the Hibernate code to close the connections when complete.
Thanks!
Thanks!
ASKER
Statement stmt = conn.createStatement();
My guess is that it can't create a connection to the DB. If that's the case, what DB2 config settings should I be looking to remedy this?