TransactionConfig (Sleepycat Software, Inc. - Berkeley DB Java API)
Keywords: com.sleepycat.db.TransactionConfig class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.3.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.db
Class TransactionConfig

    java.lang.Object
      com.sleepycat.db.TransactionConfig

All Implemented Interfaces:
  Cloneable

public class TransactionConfig
extends Object
implements Cloneable

Specifies the attributes of a database environment transaction.

Field Summary
`static TransactionConfig` | `DEFAULT`

Constructor Summary
`TransactionConfig()` An instance created using the default constructor is initialized with the system's default settings.

Method Summary
`boolean` | `getDegree2()` Return if the transaction has been configured to have degree 2 isolation.
`boolean` | `getDirtyRead()` Return if the transaction is configured to perform dirty reads.
`boolean` | `getNoSync()` Return if the transaction is configured to not write or synchronously flush the log it when commits.
`boolean` | `getNoWait()` Return if the transaction is configured to not wait if a lock request cannot be immediately granted.
`boolean` | `getSync()` Return if the transaction is configured to not write or synchronously flush the log it when commits.
`boolean` | `getWriteNoSync()` Return if the transaction is configured to write but not synchronously flush the log it when commits.
`void` | `setDegree2(boolean degree2)` Configure this transaction to have degree 2 isolation.
`void` | `setDirtyRead(boolean dirtyRead)` Configure the transaction to perform dirty reads.
`void` | `setNoSync(boolean txnNoSync)` Configure the transaction to not write or synchronously flush the log it when commits.
`void` | `setNoWait(boolean noWait)` Configure the transaction to not wait if a lock request cannot be immediately granted.
`void` | `setSync(boolean txnSync)` Configure the transaction to write or synchronously flush the log it when commits.
`void` | `setWriteNoSync(boolean txnWriteNoSync)` Configure the transaction to write but not synchronously flush the log it when commits.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT

    public static final TransactionConfig DEFAULT

Constructor Detail

### TransactionConfig

    public TransactionConfig()

  An instance created using the default constructor is initialized with the system's default settings.

Method Detail

### setDegree2

    public void setDegree2(boolean degree2)

  Configure this transaction to have degree 2 isolation. This provides for cursor stability but not repeatable reads. Data items which have been previously read by this transaction may be deleted or modified by other transactions before this transaction completes.

  The default is false for this class and the database environment.

### getDegree2

    public boolean getDegree2()

  Return if the transaction has been configured to have degree 2 isolation.

  Returns:
    If the transaction has been configured to have degree 2 isolation.

### setSync

    public void setSync(boolean txnSync)

  Configure the transaction to write or synchronously flush the log it when commits.

  This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.

  The default is false for this class and true for the database environment.

  If true is passed to both setSync and setNoSync, setSync will take precedence.

  Parameters:
    `txnSync` - If true, transactions exhibit all the ACID (atomicity, consistency, isolation, and durability) properties.

### getSync

    public boolean getSync()

  Return if the transaction is configured to not write or synchronously flush the log it when commits.

  Returns:
    If the transaction is configured to not write or synchronously flush the log it when commits.

### setWriteNoSync

    public void setWriteNoSync(boolean txnWriteNoSync)

  Configure the transaction to write but not synchronously flush the log it when commits.

  This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.

  The default is false for this class and the database environment.

  Parameters:
    `txnWriteNoSync` - If true, transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but if the operating system fails, it is possible some number of the most recently committed transactions may be undone during recovery. The number of transactions at risk is governed by how often the operating system flushes dirty buffers to disk, and how often the log is checkpointed.

### getWriteNoSync

    public boolean getWriteNoSync()

  Return if the transaction is configured to write but not synchronously flush the log it when commits.

  Returns:
    If the transaction is configured to not write or synchronously flush the log it when commits.

### setNoSync

    public void setNoSync(boolean txnNoSync)

  Configure the transaction to not write or synchronously flush the log it when commits.

  This behavior may be set for a database environment using the Environment.setMutableConfig method. Any value specified to this method overrides that setting.

  The default is false for this class and the database environment.

  Parameters:
    `txnNoSync` - If true, transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but if the application or system fails, it is possible some number of the most recently committed transactions may be undone during recovery. The number of transactions at risk is governed by how many log updates can fit into the log buffer, how often the operating system flushes dirty buffers to disk, and how often the log is checkpointed.

### getNoSync

    public boolean getNoSync()

  Return if the transaction is configured to not write or synchronously flush the log it when commits.

  Returns:
    If the transaction is configured to not write or synchronously flush the log it when commits.

### setNoWait

    public void setNoWait(boolean noWait)

  Configure the transaction to not wait if a lock request cannot be immediately granted.

  The default is false for this class and the database environment.

  Parameters:
    `noWait` - If true, transactions will not wait if a lock request cannot be immediately granted, instead `DeadlockException` will be thrown.

### getNoWait

    public boolean getNoWait()

  Return if the transaction is configured to not wait if a lock request cannot be immediately granted.

  Returns:
    If the transaction is configured to not wait if a lock request cannot be immediately granted.

### setDirtyRead

    public void setDirtyRead(boolean dirtyRead)

  Configure the transaction to perform dirty reads.

  The default is false for this class and the database environment.

  Parameters:
    `dirtyRead` - If true, all read operations performed by the transaction may read modified but not yet committed data.

### getDirtyRead

    public boolean getDirtyRead()

  Return if the transaction is configured to perform dirty reads.

  Returns:
    If the transaction is configured to perform dirty reads.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.3.29
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.