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 |
|
Any Profile MBean |
All. |
Modifier and Type | Field and Description |
---|---|
static String |
OBJECT_NAME |
Modifier and Type | Method and 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.
|
static final String OBJECT_NAME
void startUserTransaction() throws NoAuthenticatedSubjectException, NotSupportedException, ManagementException
Start a client-demarcated transaction.
The transaction is associated with the authenticated Subject
that the invoking thread is currently associated with.
A unique Subject
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.
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticated Subject
.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.void commitUserTransaction() throws NoAuthenticatedSubjectException, InvalidStateException, ProfileVerificationException, HeuristicMixedException, HeuristicRollbackException, RollbackException, ManagementException
Commit a transaction started by the client.
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticated Subject
.InvalidStateException
- if no user transaction is currently associated with the Subject
.ProfileVerificationException
- if a profile MBean was modified in the transaction and the ProfileManagement.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.HeuristicMixedException
- if a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.HeuristicRollbackException
- if a heuristic decision was made and that all relevant updates have been rolled backRollbackException
- 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.void rollbackUserTransaction() throws NoAuthenticatedSubjectException, InvalidStateException, ManagementException
Roll back a transaction stated by the client.
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticated Subject
.InvalidStateException
- if no user transaction is currently associated with the Subject
.ManagementException
- if the user transaction could not be rolled back due to a system-level failure.boolean getHasUserTransaction() throws ManagementException
Determine if a client-demaracted transaction currently exists for the user.
true
if a client-demaracted transaction currently exists for the user, false
otherwise.ManagementException
- if the transaction status could not be obtained due to a system-level failure.