Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Do Datasources have to support distributed transactions?

1 view
Skip to first unread message

solmyr72

unread,
Aug 8, 2004, 5:44:23 AM8/8/04
to
Hi,

We're trying to use a customized datasource class. It does not support distributed transactions (which are not required by the application anyway).
However, WSAD refused to allow this. At runtime, it throws an exception saying
[code]
DSRA8101E: DataSource class cannot be used as one-phase[/code]
Would anyone happen to have experienced similar problems ? help will be much appreciated.

More details:
* WSAD version: 5.0.1

* Customized datasource: p6spy (used for debugging, wrapped around oracle driver)

Partial stack trace:
[code]
[13:08:52:427 IDT 08/08/04] 642eeab FreePool E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/p6spyDs, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA8101E: DataSource class cannot be used as one-phase: ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:217)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:171)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:191)
at com.ibm.ws.rsadapter.DSConfigurationHelper.getPooledConnection(DSConfigurationHelper.java:710)

[/code]

jwhitall

unread,
Aug 16, 2004, 4:12:57 PM8/16/04
to
Hello,

I had a very similar problem. The issue is that WAS is looking for either an XADataSource or a ConnectionPoolDataSource, not just a plain old DataSource. WSJdbcDataSource is a plain old data source, hence the ClassCastException.

I'm not sure why are you using the WsJdbcDataSource directly... I don't think it is really meant to be used externally. WsJdbcDataSource sort of creates a wrapper around the data source that you end up selecting which is unique to your database implementation.

If you are connecting to a DB that doesn't have a data source implementation included with its JDBC API, you might want to consider using the DriverAdapterCPDS class in Jakarta Commons DBCP. You can wrap any JDBC driver that implements java.sql.Driver and registers with the DriverManager with this class, and you get a just-add-water ConnectionPoolDataSource that WAS won't gack on... assuming your driver is JDBC-2.0 compliant, of course. (HSQLDB 1.7.x, for instance, is not.)

Whatever you do, make sure that your data store helper is set to GenericDataStoreHelper. That should get the driver working at least. You may need to do some fine tuning with the error codes, in which case you can subclass the GenericDataStoreHelper and override what you need.

Hope this helps,
Jonathan

0 new messages