org.mmbase.bridge.implementation
Class BasicTransaction
java.lang.Object
org.mmbase.bridge.implementation.BasicCloud
org.mmbase.bridge.implementation.BasicTransaction
- All Implemented Interfaces:
- Cloneable, Cloud, Comparable, Serializable, SizeMeasurable, Transaction
- public class BasicTransaction
- extends BasicCloud
- implements Transaction
The basic implementation for a Transaction cLoud.
A Transaction cloud is a cloud which buffers allc hanegs made to nodes -
which means that chanegs are committed only if you commit the transaction itself.
This mechanism allows you to rollback changes if something goes wrong.
- Version:
- $Id: BasicTransaction.java,v 1.25 2006/06/22 07:52:14 nklasens Exp $
- Author:
- Pierre van Rooden
- See Also:
- Serialized Form
|
Method Summary |
void |
cancel()
Cancels this transaction. |
boolean |
commit()
Commits this transaction. |
protected void |
finalize()
If this Transaction is scheduled to be garbage collected, the transaction is canceled and cleaned up. |
String |
getCloudName()
Returns the name of the cloud this transaction uses |
boolean |
isCanceled()
|
boolean |
isCommitted()
|
| Methods inherited from class org.mmbase.bridge.implementation.BasicCloud |
compareTo, createAggregatedQuery, createNodeList, createNodeManagerList, createNodeQuery, createQuery, createRelationList, createRelationManagerList, createTransaction, createTransaction, createTransaction, equals, getByteSize, getByteSize, getCloudContext, getClusterNodes, getDescription, getFunction, getFunctions, getLastStepList, getList, getList, getLocale, getName, getNode, getNode, getNodeByAlias, getNodeManager, getNodeManager, getNodeManagers, getProperties, getProperty, getRelation, getRelation, getRelationManager, getRelationManager, getRelationManager, getRelationManager, getRelationManagers, getRelationManagers, getRelationManagers, getResultNodeList, getSecureList, getTransaction, getUser, hasNode, hasNode, hasNodeManager, hasRelation, hasRelation, hasRelationManager, hasRelationManager, hasRelationManager, hasRole, mayRead, mayRead, setLocale, setProperty |
| 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, getProperties, getProperty, getRelation, getRelation, getRelationManager, getRelationManager, getRelationManager, getRelationManager, getRelationManagers, getRelationManagers, getRelationManagers, getTransaction, getUser, hasNode, hasNode, hasNodeManager, hasRelation, hasRelation, hasRelationManager, hasRelationManager, hasRelationManager, hasRole, mayRead, mayRead, setLocale, setProperty |
transactionContext
protected final String transactionContext
- The id of the transaction for use with the transaction manager.
transactionName
protected final String transactionName
- The name of the transaction as used by the user.
parentCloud
protected final BasicCloud parentCloud
commit
public boolean commit()
- Description copied from interface:
Transaction
- 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).
- Specified by:
commit in interface Transaction
- Returns:
true if the commit succeeded, false
otherwise
cancel
public void cancel()
- Description copied from interface:
Transaction
- 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).
- Specified by:
cancel in interface Transaction
finalize
protected void finalize()
- If this Transaction is scheduled to be garbage collected, the transaction is canceled and cleaned up.
Unless it has already been committed/canceled, ofcourse, and
unless the parentcloud of a transaction is a transaction itself.
In that case, the parent transaction should cancel!
This means that a transaction is always cleared - if it 'times out', or is not properly removed, it will
eventually be removed from the MMBase cache.
isCanceled
public boolean isCanceled()
- Specified by:
isCanceled in interface Transaction
isCommitted
public boolean isCommitted()
- Specified by:
isCommitted in interface Transaction
getCloudName
public String getCloudName()
- Description copied from interface:
Transaction
- Returns the name of the cloud this transaction uses
- Specified by:
getCloudName in interface Transaction
- Returns:
- the name of the cloud
- See Also:
Transaction.getCloudName()
MMBase build 1.8.1.20060716