This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebSphere - DB2 DataSource Connection Problem

 
Jaime Garcia
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using DB2 7.1 and WebSphere 4.0.3. (OS Solaris 5.8) I access DB2 Data Bases with Implementation class COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource for Pool Connection (Data source). I need to access 6 diferent data bases. It works fine at the begining but sudenly It dose not get connections from pool. This is the error from WebSphere Pool:
Source: com.ibm.ejs.cm.pool.ConnectionPool
CONM6009E: Failed to get connection to the database from datasource (DB)

I am sure that I close all connections.
Any Idea ?.
The same code (none change) works in Tomcat 4.0.6 (the data source that it use is from tyrex I guess) and DB2 for Windows 7.1.
I have the license of DB2 for Windows but from Sun is a Trial version.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The very fact you say you're using pool data source worries me. Can you post the code you're using?
Kyle
 
Jaime Garcia
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code that I use to obtain the connection:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
//db is the name of the DataBase
DataSource ds = (DataSource) envCtx.lookup(db);
conn = ds.getConnection();
I have already try this one:
java.util.Properties parms = new java.util.Properties();
parms.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");

javax.naming.Context envCtx = new javax.naming.InitialContext(parms);
DataSource ds = (DataSource) envCtx.lookup("java:comp/env/"+db);
conn = ds.getConnection();
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic