public class ExternalJdbcTransaction extends JdbcTransaction
This means that the transaction demarcation [commit(), rollback(), end()] must be controlled externally (by Spring etc) and so these methods [commit(), rollback(), end()] can not be called on this ExternalJdbcTransaction.
That is, a transaction started externally (by Spring etc) must be committed or rolled back externally as well.
managerREAD_COMMITTED, READ_UNCOMMITTED, REPEATABLE_READ, SERIALIZABLE| Constructor and Description |
|---|
ExternalJdbcTransaction(Connection connection)
Create a Transaction that will have no transaction logging support.
|
ExternalJdbcTransaction(String id,
boolean explicit,
Connection connection,
TransactionManager manager)
Construct will all explicit parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
This will always throw a PersistenceException.
|
void |
end()
This will always throw a PersistenceException.
|
void |
rollback()
This will always throw a PersistenceException.
|
void |
rollback(Throwable e)
This will always throw a PersistenceException.
|
addModification, batchFlush, close, deactivate, depth, flushBatch, getBatchControl, getBatchSize, getConnection, getDerivedRelationship, getEvent, getId, getInternalConnection, getLogPrefix, getPersistenceContext, getTransactionManger, getUserObject, isActive, isBatchFlushOnQuery, isBatchThisRequest, isExplicit, isLogSql, isLogSummary, isPersistCascade, isReadOnly, isRegisteredBean, isRegisteredDeleteBean, isSaveAssocManyIntersection, logSql, logSummary, notifyCommit, notifyRollback, putUserObject, registerDeleteBean, registerDerivedRelationship, setBatchControl, setBatchFlushOnMixed, setBatchFlushOnQuery, setBatchGetGeneratedKeys, setBatchMode, setBatchSize, setLabel, setLoggingOn, setPersistCascade, setPersistenceContext, setReadOnly, toString, unregisterBean, unregisterDeleteBeanpublic ExternalJdbcTransaction(Connection connection)
You need to create with a TransactionManager to have transaction logging.
public ExternalJdbcTransaction(String id, boolean explicit, Connection connection, TransactionManager manager)
public void commit()
throws javax.persistence.RollbackException
Externally created connections should be committed or rolled back externally.
commit in interface Transactioncommit in class JdbcTransactionjavax.persistence.RollbackExceptionpublic void end()
throws javax.persistence.PersistenceException
Externally created connections should be committed or rolled back externally.
end in interface Transactionend in class JdbcTransactionjavax.persistence.PersistenceExceptionpublic void rollback()
throws javax.persistence.PersistenceException
Externally created connections should be committed or rolled back externally.
rollback in interface Transactionrollback in class JdbcTransactionjavax.persistence.PersistenceExceptionpublic void rollback(Throwable e) throws javax.persistence.PersistenceException
Externally created connections should be committed or rolled back externally.
rollback in interface Transactionrollback in class JdbcTransactionjavax.persistence.PersistenceExceptionCopyright © 2014. All Rights Reserved.