Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html')
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html56
1 files changed, 54 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html b/plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html
index 60f082da36..e627feccda 100644
--- a/plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html
+++ b/plugins/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/transaction/CDOPushTransaction.html
@@ -267,7 +267,7 @@ A <A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOTransaction.html" t
<TD><CODE><B><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOPushTransaction.html#commit()">commit</A></B>()</CODE>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Same as <A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)"><CODE>commit(null)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -275,7 +275,7 @@ A <A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOTransaction.html" t
<TD><CODE><B><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOPushTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)">commit</A></B>(<A HREF="http://help.eclipse.org/topic//org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/IProgressMonitor.html?is-external=true" title="class or interface in org.eclipse.core.runtime">IProgressMonitor</A>&nbsp;progressMonitor)</CODE>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commits the modifications of this transaction to the repository and returns a <A HREF="../../../../../org/eclipse/emf/cdo/common/commit/CDOCommitInfo.html" title="interface in org.eclipse.emf.cdo.common.commit"><CODE>commit info</CODE></A> object if successful.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -1322,6 +1322,9 @@ commit</H3>
public <A HREF="../../../../../org/eclipse/emf/cdo/common/commit/CDOCommitInfo.html" title="interface in org.eclipse.emf.cdo.common.commit">CDOCommitInfo</A> <B>commit</B>()
throws <A HREF="../../../../../org/eclipse/emf/cdo/util/CommitException.html" title="class in org.eclipse.emf.cdo.util">CommitException</A></PRE>
<DL>
+<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit()">CDOUserTransaction</A></CODE></B></DD>
+<DD>Same as <A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)"><CODE>commit(null)</CODE></A>.
+<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit()">commit</A></CODE> in interface <CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html" title="interface in org.eclipse.emf.cdo.transaction">CDOUserTransaction</A></CODE></DL>
</DD>
@@ -1339,6 +1342,55 @@ commit</H3>
public <A HREF="../../../../../org/eclipse/emf/cdo/common/commit/CDOCommitInfo.html" title="interface in org.eclipse.emf.cdo.common.commit">CDOCommitInfo</A> <B>commit</B>(<A HREF="http://help.eclipse.org/topic//org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/IProgressMonitor.html?is-external=true" title="class or interface in org.eclipse.core.runtime">IProgressMonitor</A>&nbsp;progressMonitor)
throws <A HREF="../../../../../org/eclipse/emf/cdo/util/CommitException.html" title="class in org.eclipse.emf.cdo.util">CommitException</A></PRE>
<DL>
+<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)">CDOUserTransaction</A></CODE></B></DD>
+<DD>Commits the modifications of this transaction to the repository and returns a <A HREF="../../../../../org/eclipse/emf/cdo/common/commit/CDOCommitInfo.html" title="interface in org.eclipse.emf.cdo.common.commit"><CODE>commit info</CODE></A> object if successful.
+ <p>
+ Various kinds of problems <b>can</b> cause the commit to fail and not all of them can be avoided by acquiring pessimistic <A HREF="../../../../../org/eclipse/emf/cdo/CDOObject.html#cdoWriteLock()"><CODE>locks</CODE></A>
+ on the modified objects. In particular you <b>must</b> expect and handle <A HREF="../../../../../org/eclipse/emf/cdo/util/ContainmentCycleException.html" title="class in org.eclipse.emf.cdo.util"><CODE>containment cycle exceptions</CODE></A>. The following example shows how
+ write robust transactions:
+ <pre>
+ CDOTransaction transaction = null;
+
+ try
+ {
+ transaction = session.openTransaction();
+
+ for (;;)
+ {
+ try
+ {
+ synchronized (transaction)
+ {
+ 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
+ {
+ if (transaction != null)
+ {
+ transaction.close();
+ }
+ }
+ </pre>
+
+ Note that the transaction stays functional after a any call to the <code>commit()</code> methods. If the transaction is not closed after a commit
+ it can be used to apply additional modifications to the model.
+<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html#commit(org.eclipse.core.runtime.IProgressMonitor)">commit</A></CODE> in interface <CODE><A HREF="../../../../../org/eclipse/emf/cdo/transaction/CDOUserTransaction.html" title="interface in org.eclipse.emf.cdo.transaction">CDOUserTransaction</A></CODE></DL>
</DD>

Back to the top