Hi, this may sound unintuitive (blame the javax.sql API in that case ;) but:
A ConnectionPoolDataSource is *not* a pooled datasource. A
ConnectionPoolDataSource
is a special type of source that is provided by the JDBC-driver vendor to
the Application
server vendor (never used by user code). What it does it to provide hooks to
improve pooling
reliability (by providing info that only the driver itself has access to in
other cases - for instance
bad entries will be removed from the pool *before* they're attempted to be
reused, etc etc).

The Application server then provides a DataSource with the actual pooling
sitting on top of the
ConnectionPoolDataSource (and interracting with it). This DataSource is then
in turn used by
user code. The default configuration is for Orion to provide it's own
"emulating" ConnectionPoolDataSource
since most drivers dont support the javax.sql API yet (with the exception of
Oracle and Sybase which
provide their own impls - using these will increase reliability in your
app). But there's one more factor too -
you usually dont want just pooling, but container-managed transactions as
well. This, combined with
the fact that there's no "loss" in the using the additional functionality
makes recommended datasource to
use the one specified by ejb-location (we are considering changing the name
since "ejb" is misguiding -
it can be used by any serverside component, and should too). The source
specified by ejb-location
performs both pooling and automatic (container managed) transaction
monitoring.

So, to sum up: In user code; use the source specified by ejb-location.

If you found the above explenation confusing and/or want more info on the
subject then I recommend
reading http://developer.java.sun.com/developer/Books/JDBCTutorial/ -> 3.7
(using datasources).
It is recommended reading for anyone using J2EE tech.

Hope it helps! :)

/Magnus Stenman, the Orion team

PS. We will have a howto on how to set up sources in order to take advantage
of Oracle/Sybases native
javax.sql implementation up soon, stay tuned.


----- Original Message -----
From: "David Elliott" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Thursday, April 13, 2000 1:41 PM
Subject: PooledDataSource casting prob with Orion 0.9.6


> Hey all,
>
> Has anybody else had any trouble casting a JNDI retrieved
> "com.evermind.sql.OrionPooledDataSource" into our old friend
> "javax.sql.ConnectionPoolDataSource" within an Orion 0.9.6 BMP EJB ??
>
> I get a ClassCastException when attempting an explicit cast.  However
> I am still able to cast "com.evermind.sql.DriverManagerDataSource" to
> "javax.sql.DataSource".  (So just no connection pooling until I figure
> this out).
>
> Other than that my 0.9.4 -> 0.9.6 upgrade has been trouble free.
>
> Cheers,
>
> Dave Elliot
>
> p.s. Congrats to the Orion team on another step forward with this
> kick-arse server.


Reply via email to