• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

WebSphere - DB2 DataSource Connection Problem

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic