public abstract class SpringManagedTransaction extends Object implements com.holonplatform.core.datastore.transaction.Transaction
Transaction
implementation which uses a Spring
PlatformTransactionManager
to manage the actual transaction.
startTransaction()
and endTransaction()
methods should be
used to handle transaction lifecycle.com.holonplatform.core.datastore.transaction.TransactionStatus.IllegalTransactionStatusException, com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException, com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionNotSupportedException
Constructor and Description |
---|
SpringManagedTransaction(org.springframework.transaction.PlatformTransactionManager transactionManager,
com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
commit() |
com.holonplatform.core.datastore.transaction.TransactionConfiguration |
getConfiguration()
Get the transaction configuration.
|
boolean |
isCompleted() |
boolean |
isRollbackOnly() |
void |
rollback() |
void |
setRollbackOnly() |
public SpringManagedTransaction(org.springframework.transaction.PlatformTransactionManager transactionManager, com.holonplatform.core.datastore.transaction.TransactionConfiguration configuration)
transactionManager
- The PlatformTransactionManager
to use (not
null)configuration
- The transaction configuration (not null)public com.holonplatform.core.datastore.transaction.TransactionConfiguration getConfiguration()
public boolean commit() throws com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException
commit
in interface com.holonplatform.core.datastore.transaction.Transaction
com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException
public void rollback() throws com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException
rollback
in interface com.holonplatform.core.datastore.transaction.Transaction
com.holonplatform.core.datastore.transaction.TransactionStatus.TransactionException
public boolean isCompleted()
isCompleted
in interface com.holonplatform.core.datastore.transaction.TransactionStatus
public void setRollbackOnly()
setRollbackOnly
in interface com.holonplatform.core.datastore.transaction.TransactionStatus
public boolean isRollbackOnly()
isRollbackOnly
in interface com.holonplatform.core.datastore.transaction.TransactionStatus
Copyright © 2020 The Holon Platform. All rights reserved.