public class GSServerTransaction extends ServerTransaction
Transaction.Created
EMBEDDED_CRASH_COUNT, id, mgr
Constructor and Description |
---|
GSServerTransaction()
Do not use!.
|
GSServerTransaction(TransactionManager tm,
Object id)
Ctor
|
GSServerTransaction(TransactionManager tm,
Object id,
long lease) |
GSServerTransaction(TransactionManager tm,
Object id,
TransactionParticipantDataImpl metaData) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort the transaction.
|
void |
abort(long l)
Abort the transaction, waiting for participants to be notified of the decision.
|
void |
commit()
Commit the transaction.
|
void |
commit(long l)
Commit the transaction, waiting for participants to be notified of the decision.
|
static GSServerTransaction |
create(TransactionManager tm,
Object id,
long lease) |
ServerTransaction |
createCopy() |
protected ServerTransaction |
createInstance()
Creates an instance of this class for cloning using the
ServerTransaction.createCopy()
method. |
boolean |
equals(Object obj)
Two instances are equal if they have the same transaction manager and the same transaction
id.
|
Object |
getId() |
int |
getState()
Returns the current state of the transaction.
|
int |
hashCode() |
boolean |
isXid() |
void |
join(TransactionParticipant part,
long crashCount)
Join the transaction.
|
void |
join(TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName) |
protected void |
join(TransactionParticipant part,
long crashCount,
int partitionId,
String clusterName,
Object proxy) |
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
create, getLease, getMetaData, getTransactionManager, initEmbedded, isEmbeddedMgrInProxy, isEmbeddedMgrProxySideInstance, isNested, joinIfNeededAndEmbedded, joinIfNeededAndEmbedded, needParticipantsJoin, readFromSwap, setEmbeddedMgrProxySideInstance, setLease, setMetaData, writeToSwap
public GSServerTransaction()
public GSServerTransaction(TransactionManager tm, Object id, long lease)
public GSServerTransaction(TransactionManager tm, Object id)
tm
- the local transaction manager for current transactionid
- unique id for the transaction, should be Xid
for XA transactionspublic GSServerTransaction(TransactionManager tm, Object id, TransactionParticipantDataImpl metaData)
public static GSServerTransaction create(TransactionManager tm, Object id, long lease) throws RemoteException
RemoteException
public int hashCode()
hashCode
in class ServerTransaction
public boolean equals(Object obj)
ServerTransaction
equals
in class ServerTransaction
public String toString()
toString
in class ServerTransaction
public void commit() throws UnknownTransactionException, CannotCommitException, RemoteException
Transaction
NOTCHANGED
or the COMMITTED
state, without waiting for the
transaction manager to notify all participants of the decision. If the transaction must be
aborted (because one or more participants are unable to prepare),
CannotCommitException
is thrown without waiting for the transaction manager to
notify all participants of the decision.commit
in interface Transaction
commit
in class ServerTransaction
UnknownTransactionException
- if the transaction is unknown to the manager. This may be
because the transaction ID was incorrect, or because the
transaction has proceeded to cleanup due to an earlier
commit or abort, and has been forgotten.CannotCommitException
- if the transaction reaches the ABORTED state, or is known
to have previously reached that state due to an earlier
commit or abort.RemoteException
- if a communication error occurs.public void commit(long l) throws UnknownTransactionException, CannotCommitException, TimeoutExpiredException, RemoteException
Transaction
NOTCHANGED
or the
COMMITTED
state, and the transaction manager has notified all participants of
the decision, before the specified timeout expires. If the transaction must be aborted
(because one or more participants are unable to prepare), CannotCommitException
is thrown if the transaction manager is able to notify all participants of the decision
before the specified timeout expires. If the transaction manager reaches a decision, but is
unable to notify all participants of that decision before the specified timeout expires, then
TimeoutExpiredException
is thrown. If the specified timeout expires before the
transaction manager reaches a decision, TimeoutExpiredException
is not thrown
until the manager reaches a decision.commit
in interface Transaction
commit
in class ServerTransaction
l
- timeout to wait, from the start of the call until all participants have been
notified of the transaction manager's decisionUnknownTransactionException
- if the transaction is unknown to the manager. This may be
because the transaction ID was incorrect, or because the
transaction has proceeded to cleanup due to an earlier
commit or abort, and has been forgotten.CannotCommitException
- if the transaction reaches the ABORTED state, or is known
to have previously reached that state due to an earlier
commit or abort.TimeoutExpiredException
- if the timeout expires before all participants have been
notified.RemoteException
- if a communication error occurs.public void abort() throws UnknownTransactionException, CannotAbortException, RemoteException
Transaction
abort
in interface Transaction
abort
in class ServerTransaction
UnknownTransactionException
- if the transaction is unknown to the manager. This may be
because the transaction ID was incorrect, or because the
transaction has proceeded to cleanup due to an earlier
commit or abort, and has been forgotten.CannotAbortException
- if the transaction is known to have previously reached
the COMMITTED state due to an earlier commit.RemoteException
- if a communication error occurs.public void abort(long l) throws UnknownTransactionException, CannotAbortException, TimeoutExpiredException, RemoteException
Transaction
TimeoutExpiredException
is thrown.abort
in interface Transaction
abort
in class ServerTransaction
l
- timeout to wait, from the start of the call until all participants have been
notified of the transaction manager's decision.UnknownTransactionException
- if the transaction is unknown to the manager. This may be
because the transaction ID was incorrect, or because the
transaction has proceeded to cleanup due to an earlier
commit or abort, and has been forgotten.CannotAbortException
- if the transaction is known to have previously reached
the COMMITTED state due to an earlier commit.TimeoutExpiredException
- if the timeout expires before all participants have been
notified.RemoteException
- if a communication error occurs.public void join(TransactionParticipant part, long crashCount) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
ServerTransaction
crashCount
marks the state of the storage used by the
participant for transactions. If the participant attempts to join a transaction more than
once, the crash counts must be the same. Each system crash or other event that destroys the
state of the participant's unprepared transaction storage must cause the crash count to
increase by at least one.join
in class ServerTransaction
part
- the participant joining the transactioncrashCount
- the participant's current crash countUnknownTransactionException
- if the transaction is unknown to the transaction manager,
either because the transaction ID is incorrect or because
the transaction is complete and its state has been
discarded by the manager.CannotJoinException
- if the transaction is known to the manager but is no
longer active.CrashCountException
- if the crash count provided for the participant differs
from the crash count in a previous invocation of the same
pairing of participant and transactionRemoteException
- if there is a communication errorprotected void join(TransactionParticipant part, long crashCount, int partitionId, String clusterName, Object proxy) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in class ServerTransaction
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public void join(TransactionParticipant part, long crashCount, int partitionId, String clusterName) throws UnknownTransactionException, CannotJoinException, CrashCountException, RemoteException
join
in class ServerTransaction
UnknownTransactionException
CannotJoinException
CrashCountException
RemoteException
public int getState() throws UnknownTransactionException, RemoteException
ServerTransaction
TransactionConstants
values.getState
in class ServerTransaction
int
representing the state of the transactionUnknownTransactionException
- if the transaction is unknown to the transaction manager,
either because the transaction ID is incorrect or because
the transaction is complete and its state has been
discarded by the manager.RemoteException
- if there is a communication errorTransactionConstants
public Object getId()
public boolean isXid()
isXid
in class ServerTransaction
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class ServerTransaction
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class ServerTransaction
IOException
ClassNotFoundException
protected ServerTransaction createInstance()
ServerTransaction
ServerTransaction.createCopy()
method.createInstance
in class ServerTransaction
public ServerTransaction createCopy()
createCopy
in class ServerTransaction
Copyright © GigaSpaces.