org.mmbase.bridge
Interface Transaction

All Superinterfaces:
Cloud
All Known Implementing Classes:
BasicTransaction, MockTransaction

public interface Transaction
extends Cloud

A transaction is an environment that allows for the editing of nodes within a 'safe' context. Either all edits in a transaction are comitted, or all fail. A transaction acts as a cloud. All that can be done in a cloud can be done in a transaction. For example a node retrieved using the transaction's getNode method resides in the transaction, if you change or remove the node, you can later roll it back by calling the transaction's cancel method.

Version:
$Id: Transaction.java 41186 2010-02-26 17:54:31Z michiel $
Author:
Pierre van Rooden

Field Summary
 
Fields inherited from interface org.mmbase.bridge.Cloud
PROP_IGNOREVALIDATION, PROP_REQUEST, PROP_RESPONSE, PROP_SESSIONNAME, PROP_XMLMODE
 
Method Summary
 void cancel()
          Cancels this transaction.
 boolean commit()
          Commits this transaction.
 String getCloudName()
          Returns the name of the cloud this transaction uses
 NodeList getNodes()
           
 boolean isCanceled()
          Returns whether the transaction is canceled
 boolean isCommitted()
          Returns whether the transaction is committed
 
Methods inherited from interface org.mmbase.bridge.Cloud
createAggregatedQuery, createNodeList, createNodeManagerList, createNodeQuery, createQuery, createRelationList, createRelationManagerList, createTransaction, createTransaction, createTransaction, getCloudContext, getDescription, getFunction, getFunctions, getList, getList, getLocale, getName, getNode, getNode, getNodeByAlias, getNodeManager, getNodeManager, getNodeManagers, getNonTransactionalCloud, getPossibleContexts, getProperties, getProperty, getRelation, getRelation, getRelationManager, getRelationManager, getRelationManager, getRelationManager, getRelationManagers, getRelationManagers, getRelationManagers, getTransaction, getUser, hasNode, hasNode, hasNodeManager, hasRelation, hasRelation, hasRelationManager, hasRelationManager, hasRelationManager, hasRole, may, mayRead, mayRead, setLocale, setProperty, shutdown
 

Method Detail

commit

boolean commit()
Commits this transaction. This has no effect if the transaction itself was 'nested' in another transaction. In that case, nothing happens until the 'outer' transaction commits. This routine also removes the transaction as an 'active' transaction (it cannot be opened again).

Returns:
true if the commit succeeded, false otherwise

cancel

void cancel()
Cancels this transaction. If the transaction itself was 'nested' in another transaction, that 'outer' transaction is also canceled. This routine also removes the transaction (and all outer transactions) as an 'active' transaction (it cannot be opened again).


isCommitted

boolean isCommitted()
Returns whether the transaction is committed

Returns:
true when committed
Since:
MMBase-1.8

isCanceled

boolean isCanceled()
Returns whether the transaction is canceled

Returns:
true when canceled
Since:
MMBase-1.8

getNodes

NodeList getNodes()
Since:
MMBase-1.9

getCloudName

String getCloudName()
Returns the name of the cloud this transaction uses

Returns:
the name of the cloud
Since:
MMBase-1.8


MMBase 2.0-SNAPSHOT - null