|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.dbcp.BasicDataSource
org.apache.commons.dbcp.managed.BasicManagedDataSource
public class BasicManagedDataSource
BasicManagedDataSource is an extension of BasicDataSource which creates ManagedConnections. This data source can create either create full two-phase-commit XA connections or one-phase-commit local connection. Both types of connections are committed or rolled back as part of the global transaction (a.k.a. XA transaction or JTA Transaction), but only XA connections can be recovered in the case of a system crash.
BasicManagedDataSource adds the TransactionManager and XADataSource properties. The TransactionManager property is required and is used to elist connections in global transactions. The XADataSource is optional and if set is the class name of the XADataSource class for a two-phase-commit JDBC driver. If the XADataSource property is set, the driverClassName is ignored and a DataSourceXAConnectionFactory is created. Otherwise, a standard DriverConnectionFactory is created and wrapped with a LocalXAConnectionFactory. This is not the only way to combine the commons-dbcp and commons-pool packages, but provides a "one stop shopping" solution for basic requirements.
BasicDataSource
,
ManagedConnection
Constructor Summary | |
---|---|
BasicManagedDataSource()
|
Method Summary | |
---|---|
TransactionManager |
getTransactionManager()
Gets the required transaction manager property. |
java.lang.String |
getXADataSource()
Gets the optional XADataSource class name. |
void |
setTransactionManager(TransactionManager transactionManager)
Sets the required transaction manager property. |
void |
setXADataSource(java.lang.String xaDataSource)
Sets the optional XADataSource class name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicManagedDataSource()
Method Detail |
---|
public TransactionManager getTransactionManager()
public java.lang.String getXADataSource()
public void setTransactionManager(TransactionManager transactionManager)
transactionManager
- the transaction manager used to enlist connectionspublic void setXADataSource(java.lang.String xaDataSource)
xaDataSource
- the optional XADataSource class name
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |