Package org.eclipse.emf.cdo.transaction
Interface CDOUserTransaction
- 
- All Known Subinterfaces:
- CDOTransaction,- CDOXATransaction,- InternalCDOTransaction,- InternalCDOUserTransaction,- InternalCDOXATransaction
 - All Known Implementing Classes:
- CDOPushTransaction
 
 public interface CDOUserTransactionProvides functionality that is common to bothsingletransactions anddistributed(XA) transactions.- Since:
- 2.0
- Author:
- Simon McDuff
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description CDOCommitInfocommit()Same ascommit(null).CDOCommitInfocommit(IProgressMonitor monitor)Commits the modifications of this transaction to the repository and returns acommit infoobject if successful.CDOUserSavepointgetLastSavepoint()voidrollback()CDOUserSavepointsetSavepoint()Creates a save point in theCDOTransactionthat can be used to roll back a part of the transaction
 
- 
- 
- 
Method Detail- 
commitCDOCommitInfo commit() throws ConcurrentAccessException, CommitException Same ascommit(null).- Throws:
- ConcurrentAccessException
- CommitException
- Since:
- 3.0
 
 - 
commitCDOCommitInfo commit(IProgressMonitor monitor) throws ConcurrentAccessException, CommitException Commits the modifications of this transaction to the repository and returns acommit infoobject if successful.Various kinds of problems can cause the commit to fail and not all of them can be avoided by acquiring pessimistic lockson the modified objects. In particular you must expect and handlecontainment cycle exceptions. The following example shows how write robust transactions:CDOTransaction transaction = null; try { transaction = session.openTransaction(); for (;;) { transaction.getViewLock().lock(); try { CDOResource resource = transaction.getResource("/stock/resource1"); // Modify the model here... transaction.commit(); break; } catch (ConcurrentAccessException ex) { transaction.rollback(); } catch (CommitException ex) { throw ex.wrap(); } finally { transaction.getViewLock().unlock(); } } } finally { if (transaction != null) { transaction.close(); } }Note that the transaction stays functional after a any call to thecommit()methods. If the transaction is not closed after a commit it can be used to apply additional modifications to the model.- Throws:
- ConcurrentAccessException
- CommitException
- Since:
- 3.0
 
 - 
rollbackvoid rollback() 
 - 
setSavepointCDOUserSavepoint setSavepoint() Creates a save point in theCDOTransactionthat can be used to roll back a part of the transactionSave points do not involve the server side, everything is done on the client side. - Since:
- 3.0
 
 - 
getLastSavepointCDOUserSavepoint getLastSavepoint() - Since:
- 3.0
 
 
- 
 
-