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

## com.sleepycat.je.rep
Class RollbackException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.lang.RuntimeException
                  com.sleepycat.je.DatabaseException
                      com.sleepycat.je.RunRecoveryException
                          com.sleepycat.je.EnvironmentFailureException
                              com.sleepycat.je.rep.RestartRequiredException
                                  com.sleepycat.je.rep.RollbackException

All Implemented Interfaces:
  Serializable

    public class RollbackException

extends RestartRequiredException

This asynchronous exception indicates that a new master has been selected, this `Replica`'s log is ahead of the current `Master`, and in this case, the `Replica` was unable to rollback without a recovery. As a consequence, it is possible that one or more of the most recently committed transactions may need to be rolled back, before the `Replica` can synchronize its state with that of the current `Master`.

Existing `ReplicatedEnvironment`, and consequently `Database` handles, are invalidated as a result of this exception. The application must close all old handles and create new handles before it can proceed. The actual rollback of any recently committed transactions is done when the application reinstantiates and thereby reopens the `ReplicatedEnvironment`. The application is responsible for discarding and recreating any transient state that may be associated with the committed transactions that were rolled back. `getEarliestTransactionId()` and `getEarliestTransactionCommitTime()` provide information to help determine which transactions might be rolled back. Note that it is possible that no committed transactions have been rolled back and that the application need do no adjustments, in which case `getEarliestTransactionCommitTime()` will return null.

This exception should be encountered relatively infrequently in practice, since the election mechanism favors nodes with the most advanced log when deciding upon a master. The exception, due to its nature, can only be encountered when the node is in the `Replica` state, or the node is trying to transition to the `Replica` state.

Use of weak durability requirements like `Durability.ReplicaAckPolicy.NONE` increases the likelihood of this exception.

See Also:
  `RollbackProhibitedException`, Serialized Form

Method Summary
`Long` | `getEarliestTransactionCommitTime()` Return the time in milliseconds of the earliest transaction commit that has been rolled back.
`long` | `getEarliestTransactionId()` Return the id of the earliest transaction commit that has been rolled back.
`String` | `getMessage()`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

Method Detail

### getMessage

    public String getMessage()

  Overrides:
    `getMessage` in class `EnvironmentFailureException`

### getEarliestTransactionCommitTime

    public Long getEarliestTransactionCommitTime()

  Return the time in milliseconds of the earliest transaction commit that has been rolled back. May return null if no commits have been rolled back.

### getEarliestTransactionId

    public long getEarliestTransactionId()

  Return the id of the earliest transaction commit that has been rolled back. 0 is returned if no commits have been rolled back.

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

Copyright (c) 2004-2010 Oracle. All rights reserved.