activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1005607 - in /websites/production/activemq/content: cache/main.pageCache how-do-transactions-work.html
Date Wed, 25 Jan 2017 20:22:43 GMT
Author: buildbot
Date: Wed Jan 25 20:22:43 2017
New Revision: 1005607

Log:
Production update by buildbot for activemq

Modified:
    websites/production/activemq/content/cache/main.pageCache
    websites/production/activemq/content/how-do-transactions-work.html

Modified: websites/production/activemq/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/activemq/content/how-do-transactions-work.html
==============================================================================
--- websites/production/activemq/content/how-do-transactions-work.html (original)
+++ websites/production/activemq/content/how-do-transactions-work.html Wed Jan 25 20:22:43
2017
@@ -34,7 +34,7 @@
 
     
     <title>
-    Apache ActiveMQ &#8482; -- How do transactions work
+    Apache ActiveMQ &#8482; -- How Do Transactions Work
     </title>
 </head>
 <body>
@@ -61,7 +61,7 @@
 <p></p>
         <div class="top_red_bar">
           <div id="site-breadcrumbs">
-<a href="community.html">Community</a>&nbsp;&gt;&nbsp;<a href="faq.html">FAQ</a>&nbsp;&gt;&nbsp;<a
href="using-apache-activemq.html">Using Apache ActiveMQ</a>&nbsp;&gt;&nbsp;<a
href="how-do-transactions-work.html">How do transactions work</a>
+<a href="community.html">Community</a>&nbsp;&gt;&nbsp;<a href="faq.html">FAQ</a>&nbsp;&gt;&nbsp;<a
href="using-apache-activemq.html">Using Apache ActiveMQ</a>&nbsp;&gt;&nbsp;<a
href="how-do-transactions-work.html">How Do Transactions Work</a>
           </div>
           <div id="site-quicklinks">
 <p><a shape="rect" href="download.html">Download</a> | <a shape="rect"
class="external-link" href="http://activemq.apache.org/maven/apidocs/index.html">JavaDocs</a>
<a shape="rect" href="javadocs.html">More...</a> | <a shape="rect" href="source.html">Source</a>
| <a shape="rect" href="discussion-forums.html">Forums</a> | <a shape="rect"
href="support.html">Support</a></p>
@@ -72,24 +72,7 @@
   <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent">
-
-<p>There are 2 kinds of transaction support in ActiveMQ. </p>
-
-<ul><li>JMS transactions - the commit() / rollback() methods on a Session  (which
is like doing commit() / rollback() on a JDBC connection)</li><li>XA Transactions
- where the <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQXASession.html">XASession</a>
acts as an <a shape="rect" class="external-link" href="http://java.sun.com/j2ee/1.4/docs/api/javax/transaction/xa/XAResource.html"
rel="nofollow">XAResource</a> by communicating with the Message Broker, rather like
a JDBC Connection takes place in an XA transaction by communicating with the database.</li></ul>
-
-
-<p>They are both implemented fairly similarly. When operations are carried out on a
transacted (or XA transacted) session, a transaction command is sent to the broker, with a
unique transaction ID which is then followed by all the usual commands (send message, acknowledge
message etc). </p>
-
-<p>Then when a <code>commit()</code> or <code>rollback()</code>
is called on the Session, this command is sent to the broker for it to commit or rollback
the transaction.</p>
-
-<p>Now the operations carried out on a transacted session inside a transaction, like
a send message or acknowledge message, do not really perform a real send or acknowledge until
the commit occurs. So the Broker explicitly handles these cases separately - essentially buffering
up the commands until the commit occurs when the messages are really sent or acknowledged.</p>
-
-<p>For that we have <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/store/TransactionStore.html">TransactionStore</a>
(implemented for all persistence adapters) that handle transactions. <code>TransactionStore</code>
will cache all messages and acks until commit or rollback occurs. Besides storing messages,
broker will withhold dispatching any of the messages until the session commit.</p>
-
-<p>If you wanna see the code, take a look at <a shape="rect" class="external-link"
href="https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java">MemoryTransactionStore</a>
which proxies transactions for Memory and JDBC persistence adapters.</p>
-
-<p>The only real difference with XA transactions is that at the PREPARE stage we MUST
write every command we have received (the send message or acknowledge message commands) to
a persistent store so that we can recover properly.</p></div>
+<div class="wiki-content maincontent"><p>There are two levels of transaction
support in ActiveMQ:</p><ul><li>JMS Transactions - the&#160;<strong><code>commit()/</code></strong><strong><code>rollback()</code></strong>
methods on a Session (which is like doing&#160;<strong><code>commit()/</code></strong><strong><code>rollback()</code></strong>
on a JDBC connection)</li><li>XA Transactions - where the <a shape="rect" class="external-link"
href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/ActiveMQXASession.html">XASession</a>
acts as an <a shape="rect" class="external-link" href="http://java.sun.com/j2ee/1.4/docs/api/javax/transaction/xa/XAResource.html"
rel="nofollow">XAResource</a> by communicating with the Message Broker, rather like
a JDBC Connection takes place in an XA transaction by communicating with the database.</li></ul><p>They
are both implemented in a similar manner. When operations are carried out on a transacted
(or XA transacted) session, a
  transaction command is sent to the broker, with a unique transaction ID which is then followed
by all the usual commands (send message, acknowledge message etc). When a <strong><code>commit()</code></strong>
or <strong><code>rollback()</code></strong> is called on the Session,
this command is sent to the broker for it to commit or rollback the transaction.</p><p>Now
the operations carried out on a transacted session inside a transaction, like a send message
or acknowledge message, do not really perform a real send or acknowledge until the commit
occurs. So the Broker explicitly handles these cases separately - essentially buffering up
the commands until the commit occurs when the messages are really sent or acknowledged.</p><p>ActiveMQ
uses <a shape="rect" class="external-link" href="http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/store/TransactionStore.html">TransactionStore</a>
(implemented by all persistence adapters) to handle transactions. <strong><c
 ode>TransactionStore</code></strong> will cache all messages and ACKs until
commit or rollback occurs. Besides storing messages, the broker will withhold dispatching
any of the messages until the session commit. If you wanna see the code, take a look at <a
shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/memory/MemoryTransactionStore.java">MemoryTransactionStore</a>
which proxies transactions for Memory and JDBC persistence adapters.&#160; The only real
difference with XA transactions is that at the PREPARE stage we MUST write every command we
have received (the send message or acknowledge message commands) to a persistent store so
that we can recover properly.</p></div>
         </td>
         <td valign="top">
           <div class="navigation">



Mime
View raw message