public class LocalXAConnectionFactory extends java.lang.Object implements XAConnectionFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
LocalXAConnectionFactory.LocalXAResource
LocalXAResource is a fake XAResource for non-XA connections.
|
Modifier and Type | Field and Description |
---|---|
protected ConnectionFactory |
connectionFactory |
protected TransactionRegistry |
transactionRegistry |
Constructor and Description |
---|
LocalXAConnectionFactory(javax.transaction.TransactionManager transactionManager,
ConnectionFactory connectionFactory)
Creates an LocalXAConnectionFactory which uses the specified connection factory to create database
connections.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
createConnection()
Create a new
Connection in an implementation specific fashion. |
TransactionRegistry |
getTransactionRegistry()
Gets the TransactionRegistry for this connection factory which contains a the
XAResource for every connection created by this factory.
|
protected TransactionRegistry transactionRegistry
protected ConnectionFactory connectionFactory
public LocalXAConnectionFactory(javax.transaction.TransactionManager transactionManager, ConnectionFactory connectionFactory)
transactionManager
- the transaction manager in which connections will be enlistedconnectionFactory
- the connection factory from which connections will be retrievedpublic TransactionRegistry getTransactionRegistry()
XAConnectionFactory
getTransactionRegistry
in interface XAConnectionFactory
public java.sql.Connection createConnection() throws java.sql.SQLException
XAConnectionFactory
Connection
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 ConnectionFactory
createConnection
in interface XAConnectionFactory
Connection
java.sql.SQLException
- if a database error occurs creating the connection