safejdbc
Class TxDataSourceAdapter

java.lang.Object
  |
  +--safejdbc.DataSourceAdapter
        |
        +--safejdbc.TxDataSourceAdapter
All Implemented Interfaces:
ConnectionProvider

public class TxDataSourceAdapter
extends DataSourceAdapter

Some J2EE environments (e.g. BEA Weblogic 7.0) are providing DataSources with special behaviors (i.e. Connections provided by these DataSources are throwing an Exception when "commit" or "rollback" is invoked).
The TxDataSourceAdapter wrapps such "special" DataSources and returns Proxy-Connections to the framework, wich are ignoring calls to "commit" or "rollback".
As a rule of thumb, you should use a TxDataSourceAdapter, when transactions are managed "externaly" (e.g. by a J2EE container).


Constructor Summary
TxDataSourceAdapter(javax.sql.DataSource datasource)
           
 
Method Summary
 java.sql.Connection getConnection()
          This method is called to actually give the connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxDataSourceAdapter

public TxDataSourceAdapter(javax.sql.DataSource datasource)
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from interface: ConnectionProvider
This method is called to actually give the connection
Overrides:
getConnection in class DataSourceAdapter


Copyright (c) 2001, 2002 by Jan Hermanns and Arno Haase. All Rights Reserved.