|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.transaction.TransactionOptions
public final class TransactionOptions
Contains the configuration for a Hazelcast transaction.
Nested Class Summary | |
---|---|
static class |
TransactionOptions.TransactionType
|
Constructor Summary | |
---|---|
TransactionOptions()
Creates a new default configured TransactionsOptions. |
Method Summary | |
---|---|
static TransactionOptions |
getDefault()
Creates a new TransactionOptions configured with default settings. |
int |
getDurability()
Gets the transaction durability. |
long |
getTimeoutMillis()
Gets the timeout in milliseconds. |
TransactionOptions.TransactionType |
getTransactionType()
Gets the TransactionOptions.TransactionType . |
void |
readData(com.hazelcast.nio.ObjectDataInput in)
|
TransactionOptions |
setDurability(int durability)
Sets the transaction durability. |
TransactionOptions |
setTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout. |
TransactionOptions |
setTransactionType(TransactionOptions.TransactionType transactionType)
Sets the TransactionOptions.TransactionType . |
String |
toString()
|
void |
writeData(com.hazelcast.nio.ObjectDataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TransactionOptions()
Method Detail |
---|
public TransactionOptions.TransactionType getTransactionType()
TransactionOptions.TransactionType
.
public TransactionOptions setTransactionType(TransactionOptions.TransactionType transactionType)
TransactionOptions.TransactionType
.
A local transaction is less safe than a two phase transaction; when a member fails during the commit
of a local transaction, it could be that some of the changes are committed, while others are not and this
can leave your system in an inconsistent state.
transactionType
- the new TransactionType.
getTransactionType()
,
setDurability(int)
public long getTimeoutMillis()
setTimeout(long, java.util.concurrent.TimeUnit)
public TransactionOptions setTimeout(long timeout, TimeUnit timeUnit)
timeout
- the timeout.timeUnit
- the TimeUnit of the timeout.
IllegalArgumentException
- if timeout smaller or equal than 0, or timeUnit is null.getTimeoutMillis()
public int getDurability()
setDurability(int)
public TransactionOptions setDurability(int durability)
TransactionOptions.TransactionType.TWO_PHASE
is selected.
durability
- the durability
IllegalArgumentException
- if durability smaller than 0.public static TransactionOptions getDefault()
TransactionOptions()
public void writeData(com.hazelcast.nio.ObjectDataOutput out) throws IOException
writeData
in interface DataSerializable
IOException
public void readData(com.hazelcast.nio.ObjectDataInput in) throws IOException
readData
in interface DataSerializable
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |