public class LocalXAConnectionFactory extends Object implements XAConnectionFactory
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LocalXAConnectionFactory.LocalXAResource
LocalXAResource is a fake XAResource for non-XA connections.
|
| Constructor and Description |
|---|
LocalXAConnectionFactory(TransactionManager transactionManager,
ConnectionFactory connectionFactory)
Creates an LocalXAConnectionFactory which uses the specified connection factory to create database connections.
|
LocalXAConnectionFactory(TransactionManager transactionManager,
TransactionSynchronizationRegistry transactionSynchronizationRegistry,
ConnectionFactory connectionFactory)
Creates an LocalXAConnectionFactory which uses the specified connection factory to create database connections.
|
| Modifier and Type | Method and Description |
|---|---|
Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
ConnectionFactory |
getConnectionFactory() |
TransactionRegistry |
getTransactionRegistry()
Gets the TransactionRegistry for this connection factory which contains a the XAResource for every connection
created by this factory.
|
public LocalXAConnectionFactory(TransactionManager transactionManager, ConnectionFactory connectionFactory)
transactionManager - the transaction manager in which connections will be enlistedconnectionFactory - the connection factory from which connections will be retrievedpublic LocalXAConnectionFactory(TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry, ConnectionFactory connectionFactory)
transactionManager - the transaction manager in which connections will be enlistedtransactionSynchronizationRegistry - the optional TSR to register synchronizations withconnectionFactory - the connection factory from which connections will be retrievedpublic Connection createConnection() throws SQLException
XAConnectionFactoryConnection in an implementation specific fashion.
An implementation can assume that the caller of this will wrap the connection in a proxy that protects access to the setAutoCommit, commit and rollback when enrolled in a XA transaction.
createConnection in interface ConnectionFactorycreateConnection in interface XAConnectionFactoryConnectionSQLException - if a database error occurs creating the connectionpublic ConnectionFactory getConnectionFactory()
public TransactionRegistry getTransactionRegistry()
XAConnectionFactorygetTransactionRegistry in interface XAConnectionFactoryCopyright © 2001–2020 The Apache Software Foundation. All rights reserved.