public final class TransactionOptions extends Object implements DataSerializable
Modifier and Type | Class and Description |
---|---|
static class |
TransactionOptions.TransactionType |
Constructor and Description |
---|
TransactionOptions()
Creates a new default configured TransactionsOptions.
|
Modifier and Type | Method and Description |
---|---|
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) |
public TransactionOptions()
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 durabilityIllegalArgumentException
- 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
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.