[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

DB2 ERRORCODE=-4499, SQLSTATE=08001

Posted on 2009-06-30
13
Medium Priority
?
48,389 Views
Last Modified: 2012-05-07
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.DB2Driver@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.NullPointerException
        at edi2.EDIMain.mycarrierAppStart(EDIMain.java:472)
        at edi2.EDIMain.carrierAppStart(EDIMain.java:293)
        at ANTHEMBCBSMO.ANTHEMBCBSMOMain.main(ANTHEMBCBSMOMain.java:38)
 Exceptionnull
Job is terminated    :
Exception in thread "main" java.lang.NullPointerException
        at java.io.DataOutputStream.writeBytes(Unknown Source)
        at edi2.JobDetails.fileOutputStream(JobDetails.java:99)
        at edi2.JobDetails.appendToFile(JobDetails.java:91)
        at edi2.EDIMain.carrierAppStart(EDIMain.java:328)
        at ANTHEMBCBSMO.ANTHEMBCBSMOMain.main(ANTHEMBCBSMOMain.java:38)
0
Comment
Question by:iamtheiam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
  • +1
13 Comments
 

Author Comment

by:iamtheiam
ID: 24748377
HEre is the line that it seems to stop at

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?
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 24748484
are you releasing the connections once your done with them?
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24748913
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 ?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:iamtheiam
ID: 24749620
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
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24749863
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.
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 24753610
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
0
 

Author Comment

by:iamtheiam
ID: 24754002
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.
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 24754034
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
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24754248
This is not a proper way to do. Since your application does not close database connections properliy before terminating. There are connections stay open to your database. So they accumulate and it reaches a point that db2 won't be accepting any more connections.


The best way to avoid the situation is to close all database connections before terminating the application. so I believe you need to modify your program to properly close all db connections before quitting. This is the only viable solution for the time being.

I am still suspecting that your application connects to database through hibernate. So it seems that your application does not close hibernate connections or attempts to reuse and when it starts it opens new connections regardless of the DB connection state. It might be a good idea to check for DB conenction first and attempt to open new connections it if this operation fails.

Cheers,
K.
0
 

Author Comment

by:iamtheiam
ID: 24754298
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.  
0
 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 500 total points
ID: 24754327

Make sure that the code doesn't "skip" the call to close() when an error or unforseen event occurs.


Kent
0
 

Author Comment

by:iamtheiam
ID: 24754399
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.
0
 

Author Closing Comment

by:iamtheiam
ID: 31598480
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!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question