Websphere 4.0 and connection pooling problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Application Server > Websphere 4.0 and connection pooling problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Websphere 4.0 and connection pooling problem  
Bob


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-22-04 10:38 PM

I'm attempting to use a third party JDBC driver that supports the JDBC
2.0 connection pool datasource API (javax.sql.ConnectionPoolDataSource),
but I've been unable to get pooling working with Websphere 4.0. We can
create the datasource in the admin console using the JDBC Provider and
the "Test Connection" button makes a successful connection. Driver
traces and other info confirm that the datasource was successfully
instantiated, made a connection to DB2 and closed the connection,
however, attempting to acquire the datasource via JNDI results in a
ClassCastException for com.ibm.ejs.cm.JDBC1PhaseRef. I have no idea what
that is, but it's not the class name of the drivers
ConnectionPoolDataSource implementation.

Has anyone successfully used Websphere 4.0's connection pooling
mechanism with 3rd party DB2 drivers? If so could you provide details on
how to configure them?

TIA,

Bob






[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Ole Eirik Dalbye


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-23-04 12:29 PM

Bob <removegandalf@removecal.net> wrote in message news:<20040522115330205-0700@news.cal.net
>...
> I'm attempting to use a third party JDBC driver that supports the JDBC
> 2.0 connection pool datasource API (javax.sql.ConnectionPoolDataSource),
> but I've been unable to get pooling working with Websphere 4.0. We can
> create the datasource in the admin console using the JDBC Provider and
> the "Test Connection" button makes a successful connection. Driver
> traces and other info confirm that the datasource was successfully
> instantiated, made a connection to DB2 and closed the connection,
> however, attempting to acquire the datasource via JNDI results in a
> ClassCastException for com.ibm.ejs.cm.JDBC1PhaseRef. I have no idea what
> that is, but it's not the class name of the drivers
> ConnectionPoolDataSource implementation.
>
>   Has anyone successfully used Websphere 4.0's connection pooling
> mechanism with 3rd party DB2 drivers? If so could you provide details on
> how to configure them?
>
> TIA,
>
> Bob


I was under the impression that your DB2 server had to be made ready
to accept the JDBC 2.0 API. The way you do that is stopping all the
DB2 services, go into your SQLIB/java12 folder and run the usejdbc2
file. Make sure you don't get any error messages becuase of running
services, then restart the DB2 services.





[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Ken Hygh


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-23-04 05:08 PM

Bob wrote:

>  I'm attempting to use a third party JDBC driver that supports the JDBC
>2.0 connection pool datasource API (javax.sql.ConnectionPoolDataSource),
>but I've been unable to get pooling working with Websphere 4.0. We can
>create the datasource in the admin console using the JDBC Provider and
>the "Test Connection" button makes a successful connection. Driver
>traces and other info confirm that the datasource was successfully
>instantiated, made a connection to DB2 and closed the connection,
>however, attempting to acquire the datasource via JNDI results in a
>ClassCastException for com.ibm.ejs.cm.JDBC1PhaseRef. I have no idea what
>that is, but it's not the class name of the drivers
>ConnectionPoolDataSource implementation.
>
>  Has anyone successfully used Websphere 4.0's connection pooling
>mechanism with 3rd party DB2 drivers? If so could you provide details on
>how to configure them?
>
>TIA,
>
>Bob
>
>
>
What's your code look like that gets the datasource? I've only used the
JDBC drivers delivered with DB2, so I can't help there.

Ken





[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
DB2


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-23-04 05:08 PM

Have at look at StarSQL for Java (www.starquest.com), it does support
connection pooling.

Bob <removegandalf@removecal.net> wrote in message news:<20040522115330205-0700@news.cal.net
>...
> I'm attempting to use a third party JDBC driver that supports the JDBC
> 2.0 connection pool datasource API (javax.sql.ConnectionPoolDataSource),
> but I've been unable to get pooling working with Websphere 4.0. We can
> create the datasource in the admin console using the JDBC Provider and
> the "Test Connection" button makes a successful connection. Driver
> traces and other info confirm that the datasource was successfully
> instantiated, made a connection to DB2 and closed the connection,
> however, attempting to acquire the datasource via JNDI results in a
> ClassCastException for com.ibm.ejs.cm.JDBC1PhaseRef. I have no idea what
> that is, but it's not the class name of the drivers
> ConnectionPoolDataSource implementation.
>
>   Has anyone successfully used Websphere 4.0's connection pooling
> mechanism with 3rd party DB2 drivers? If so could you provide details on
> how to configure them?
>
> TIA,
>
> Bob





[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Bob


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-23-04 09:29 PM

In <a78ec628.0405230439.69fd0173@posting.google.com> DB2 wrote:
> Have at look at StarSQL for Java (www.starquest.com), it does support
> connection pooling.
>
> Bob <removegandalf@removecal.net> wrote in message news:
> <20040522115330205-0700@news.cal.net>... 
>

That's what I'm using. I configured a datasource using the admin
console. The implementation class is com.starsql.datasource.
SQConnectionPoolDataSource and the JNDI name is jdbc/DB2V7S. In my app I
do:

ctx = new InitialContext();
ds = (ConnectionPoolDataSource)ctx.lookup("jdbc/DB2V7S");

The ClassCastException is occurring on the lookup() method call. Is
there anything else I need to configure (or modify) to get this working?

Bob








[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Manglu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-04 04:29 AM

Bob,

You usually cast it to a javax.sql.DataSource Class not the
ConnectionPoolDataSource

I believe this ConnectionPoolDataSource is there since JDK1.4 while
WAS 4.0 lives on JDK 1.3


I havne't used ConnectionpoolDataSource but the usual cast from a JNDI
Data Source is

ds test = (DataSource) ctx.lookup("jdbc/value");

This is the case no matter whether you use DB2 JDBC Drivers or third
party drivers.

HTH
Manglu





[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Bob


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-24-04 09:31 PM

In <2ae5cba9.0405231828.41cabef0@posting.google.com> Manglu wrote:
> Bob,
>
> You usually cast it to a javax.sql.DataSource Class not the
> ConnectionPoolDataSource
>
> I believe this ConnectionPoolDataSource is there since JDK1.4 while
> WAS 4.0 lives on JDK 1.3
>
>
> I havne't used ConnectionpoolDataSource but the usual cast from a JNDI
> Data Source is
>
> ds test = (DataSource) ctx.lookup("jdbc/value");
>
> This is the case no matter whether you use DB2 JDBC Drivers or third
> party drivers.
>
> HTH
> Manglu
>

That's incorrect on two counts. The datasource retrieved via the JNDI
lookup must be cast to javax.sql.ConnectionPoolDataSource in order to
call the method getPooledConnection(), which is the method used to
retrieve a Connection from a ConnectionPoolDataSource. The parent class
javax.sql.Datasource has no such method.
Secondly, the javax.sql.ConnectionPoolDataSource was introduced
originally in the JDBC 2.0 extensions (jdbc2_0-stdext.jar) which are
compatible with jdk 1.3.






[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Manglu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-25-04 04:30 AM

Bob,

I am willing to be corrected.

But this is what i see from the docs

http://java.sun.com/j2se/1.4.2/docs...Connection.html

which is returned on a getPooledConnection states that:

<snip>
An object that provides hooks for connection pool management. A
PooledConnection object represents a physical connection to a data
source. The connection can be recycled rather than being closed when
an application is finished with it, thus reducing the number of
connections that need to be made.

An application programmer does not use the PooledConnection interface
directly; rather, it is used by a middle tier infrastructure that
manages the pooling of connections.

When an application calls the method DataSource.getConnection, it gets
back a Connection object. If connection pooling is being done, that
Connection object is actually a handle to a PooledConnection object,
which is a physical connection.

</snip>

Notice that the doc indicates that we as Application programmers donot
use the PooledConnection and the application uses it indirectly via
the DataSource.getConnection.


Hope this makes things clearer.
Manglu





[ Post a follow-up to this message ]



    Re: Websphere 4.0 and connection pooling problem  
Bob


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-30-04 04:35 AM

And so am I;-) You were absolutely correct the first time. My apologies.

In <2ae5cba9.0405241813.52dc1dcd@posting.google.com> Manglu wrote:
> Bob,
>
> I am willing to be corrected.
>
> But this is what i see from the docs
>
> http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/
> ConnectionPoolDataSource.html
>
> The URL above states it is from
> Since:
> 1.4
>
> so i inferred that this available since JDK 1.4
>
> http://java.sun.com/j2se/1.4.2/docs...oledConnection.
> html
>
> which is returned on a getPooledConnection states that:
>
> <snip>
> An object that provides hooks for connection pool management. A
> PooledConnection object represents a physical connection to a data
> source. The connection can be recycled rather than being closed when
> an application is finished with it, thus reducing the number of
> connections that need to be made.
>
> An application programmer does not use the PooledConnection interface
> directly; rather, it is used by a middle tier infrastructure that
> manages the pooling of connections.
>
> When an application calls the method DataSource.getConnection, it gets
> back a Connection object. If connection pooling is being done, that
> Connection object is actually a handle to a PooledConnection object,
> which is a physical connection.
>
> </snip>
>
> Notice that the doc indicates that we as Application programmers donot
> use the PooledConnection and the application uses it indirectly via
> the DataSource.getConnection.
>
>
> Hope this makes things clearer.
> Manglu
>






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:10 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register