Interface UserTransactionManagementMBean
-
public interface UserTransactionManagementMBean
The
UserTransactionManagerMBean
interface defines a mechanism for management client applications to control transaction demarcation on management operations.The table below lists the MBean operations that support user transactions in Rhino:
MBean Operations Profile Provisioning MBean
createProfileTable
removeProfileTable
,getProfileTables
getProfileTables(ProfileSpecificationID)
,createProfile
,createProfiles
removeProfile
,getDefaultProfile
getProfile
,getProfilesByIndexedAttribute
getProfilesByAttribute
,getProfilesByStaticQuery
getProfilesByDynamicQuery
importProfiles
Any Profile MBean
All.
Any Profile MBean accessed while a user transaction is in effect is enlisted into the user transaction and automatically assumes the read/write state. Modifications to the profile will occur within the context of the user transaction. It is not possible to invoke theProfileMBean.commitProfile()
orProfileMBean.restoreProfile()
operations on a Profile MBean enlisted in a user transaction - any changes made to such a profile will be committed or rolled back, and the Profile MBean reverted to the read-only state, when the user transaction is committed or rolled back, respectively.
-
-
Field Summary
Fields Modifier and Type Field Description static String
OBJECT_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commitUserTransaction()
Commit a transaction started by the client.boolean
getHasUserTransaction()
Determine if a client-demaracted transaction currently exists for the user.void
rollbackUserTransaction()
Roll back a transaction stated by the client.void
startUserTransaction()
Start a client-demarcated transaction.
-
-
-
Field Detail
-
OBJECT_NAME
static final String OBJECT_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
startUserTransaction
@SupportsUserTransactions void startUserTransaction() throws NoAuthenticatedSubjectException, javax.transaction.NotSupportedException, ManagementException
Start a client-demarcated transaction. The transaction is associated with the authenticated
Subject
that the invoking thread is currently associated with. A uniqueSubject
exists for each authenticated user, even if the user has authenticated each time with the same username and password.A transaction started by a user remains active until explicitly committed or rolled back using the methods on this MBean.
Transactions are local to individual Rhino nodes. It is not possible to start a user transaction on one Rhino node and invoke management commands within that transaction from another node.
- Throws:
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticatedSubject
.javax.transaction.NotSupportedException
- if the client has already started a user transaction. Nested transactions are not supported.ManagementException
- if the user transaction cannot be started due to a system-level failure.
-
commitUserTransaction
@SupportsUserTransactions void commitUserTransaction() throws NoAuthenticatedSubjectException, InvalidStateException, ProfileVerificationException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, javax.transaction.RollbackException, ManagementException
Commit a transaction started by the client.
- Throws:
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticatedSubject
.InvalidStateException
- if no user transaction is currently associated with theSubject
.ProfileVerificationException
- if a profile MBean was modified in the transaction and theProfileManagement.profileVerify()
callback method of the profile’s Profile Management Abstract Class throws this exception. This exception can also be thrown by the profile MBean if the deployment descriptor for the profile specification documents an indexed attribute as requiring unique values and a non-unique value has been supplied in the profile. If this exception is thrown, the user transaction remains active, allowing the client to resolve the profile verification error and attempt to commit the transaction again.javax.transaction.HeuristicMixedException
- if a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.javax.transaction.HeuristicRollbackException
- if a heuristic decision was made and that all relevant updates have been rolled backjavax.transaction.RollbackException
- if the transaction has been rolled back instead of committed.ManagementException
- if the user transaction could not be committed due to a system-level failure.
-
rollbackUserTransaction
@SupportsUserTransactions void rollbackUserTransaction() throws NoAuthenticatedSubjectException, InvalidStateException, ManagementException
Roll back a transaction stated by the client.
- Throws:
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticatedSubject
.InvalidStateException
- if no user transaction is currently associated with theSubject
.ManagementException
- if the user transaction could not be rolled back due to a system-level failure.
-
getHasUserTransaction
@SupportsUserTransactions boolean getHasUserTransaction() throws ManagementException
Determine if a client-demaracted transaction currently exists for the user.
- Returns:
true
if a client-demaracted transaction currently exists for the user,false
otherwise.- Throws:
ManagementException
- if the transaction status could not be obtained due to a system-level failure.
-
-