org.apache.jdo.store
Interface Connector

All Known Implementing Classes:
FOStoreConnector

public interface Connector

A Connector is the store-independent means of representing a connection. Each different kind of store should implement it's own connector, which delegates the operations to its particular kind of connection.

Author:
Dave Bristor

Method Summary
 void beforeCompletion()
          Informs the Connector that the transaction has reached it's beforeCompletion phase.
 void begin(boolean optimistic)
          Informs the Connector that a transaction is beginning.
 void commit()
          Requests that the Connector make all changes made since the previous commit/rollback permanent and releases any database locks held by the Connector.
 void flush()
          Requests that the Connector send all pending database operations to the store.
 boolean getRollbackOnly()
          Indicates whether or not the connector can do operations other than rollback.
 void rollback()
          Requests that the Connector drop all changes made since the previous commit/rollback and releases any database locks currently held by this Connector.
 void setRollbackOnly()
          Requests that the Connector put itself in a state such that the only allowable operations is getRollbackOnly().
 

Method Detail

begin

public void begin(boolean optimistic)
Informs the Connector that a transaction is beginning.

Parameters:
optimistic - If true, then an optimistic transaction is beginning.
Throws:
JDODataStoreException - is [@link setRollbackOnly} has been invoked on this Connector.

beforeCompletion

public void beforeCompletion()
Informs the Connector that the transaction has reached it's beforeCompletion phase.

Throws:
JDODataStoreException - is [@link setRollbackOnly} has been invoked on this Connector.

flush

public void flush()
Requests that the Connector send all pending database operations to the store.

Throws:
JDODataStoreException - is [@link setRollbackOnly} has been invoked on this Connector.

commit

public void commit()
Requests that the Connector make all changes made since the previous commit/rollback permanent and releases any database locks held by the Connector.

Throws:
JDODataStoreException - is [@link setRollbackOnly} has been invoked on this Connector.

rollback

public void rollback()
Requests that the Connector drop all changes made since the previous commit/rollback and releases any database locks currently held by this Connector.


setRollbackOnly

public void setRollbackOnly()
Requests that the Connector put itself in a state such that the only allowable operations is getRollbackOnly(). Once set, attempts to do any other operations will result in a JDODataStoreException.


getRollbackOnly

public boolean getRollbackOnly()
Indicates whether or not the connector can do operations other than rollback.

Returns:
false if the connector can do operations other than rollback.