Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connect to DB2 using WAS Datasource- StaleConnection,ErrorCode -30,081,SQLState40003

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I configured datasource in WAS5.1x to connect to DB2. DB2 runs in mainframe.

On my first attempt to connect to DB2, I get Staleconnection error. It works fine for consecutive attempts to connect to DB2 using WAS datasource.

From what I understand, it fails (or, shows StaleConnection) as the connection that it is holding from pool is stale. However, if it is the first attempt to connect to DB2 by the first user (first user of the application for testing purpose), I should not see this symptom.

I looked at connection pooling and did not make any difference by raising connection size etc.

Do I need further configurations in WAS datasource to make sure that stateconnection does not happen? DB2 was up and running all the time.

I get error below on my first attempt only. On consecutive attempts, it successfully connects to datasource.

I get error below:

StaleConnecti A CONM7007I: Mapping the following SQLException, with ErrorCode -30,081 and SQLState 40003, to a StaleConnectionException: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "". Communication function detecting the error: "recv". Protocol specific error code(s): "*", "*", "0". SQLSTATE=08001
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic