anchor.diff:  the destination is a mock endpoint.
   
   First we configure the standard Spring XML to declare a JMS connection
  -factory, a JMS transaction manager and our ActiveMQ component that we
  +factory, a JMS transaction manager and our xref:ROOT:activemq-component.adoc[ActiveMQ] component that we
   use in our routing.
   
   [source,xml]
  
positive.code: </camelContext>
  ----
  
  
negative.code: === About JTA Transactions
  
  TODO:
  TODO: (`camel-jta`)
  
  == Using Transactions in Camel
  
  In Camel, transactions are used by:
  
  . Setting up transaction manager via either Spring Transactions or JTA Transactions.
  . Marking routes as transacted
  . Using different transaction propagations for rare use-cases
  
  You will later in the two transactional examples further below, see how to set up transaction manager in Camel.
  
  === Marking a route as transacted
  
  When using transactions (JTA or Spring Transaction) in Camel then you enable this on routes by using `transacted`
  right after `from` in the routes.
  
  For example in Java that would be:
  
  [source,java]
  ----
  from("jms:cheese")
      .transacted()
      .to("bean:foo");
  ----
  
  And in XML:
  
  [source,xml]
  ----
  <route>
      <from uri="jms:cheese"/>
      <transacted/>
      <to uri="bean:foo"/>
  </route>
  ----
  
  When you specify `<transacted/>` in a route, Camel uses transactions for that particular
  route and any other routes that the message may undertake.
  
  When a route is specified as `<transacted/>`, then under the hood Camel looks up
  the Spring/JTA transaction manager and uses it. This is convention over configuration.
  
  The convention over configuration applies only when you have a single Spring/JTA transaction
  manager configured. In more complex scenarios, where you either use multiple
  transaction managers or transaction propagation policies, you have to do additional
  configuration.
  
  === Using different transaction propagations
  
  In some rare situations, you may need to use multiple transactions with the same exchange.
  
  For example an exchange starts off using `PROPAGATION_REQUIRED`, and then you need
  to use another transaction that’s independent of the existing transaction. You can
  do this by using PROPAGATION_REQUIRES_NEW, which will start a new transaction.
  
  NOTE: In Camel a route can only have exactly one transaction policy, which means, that if
  you need to change transaction propagation, then you must use a new route.
  
  When the exchange completes, the transaction manager will issue commits
  or rollbacks to these two transactions, which ensures that they both complete at
  the same time. Because two transaction legs are in play, they can have different
  outcomes; for example, transaction 1 can roll back, while transaction 2 commits,
  and vice versa.
  
  In Camel, you need to configure the propagations using `SpringTransactionPolicy`
  as shown in the following XML snippets:
  
  [source,xml]
  ----
  <bean id="txRequired" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
      <property name="transactionManager" ref="jmsTransactionManager"/>
  </bean>
  
  <bean id="txRequiresNew" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
      <property name="transactionManager" ref="jmsTransactionManager"/>
      <property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW"/>
  </bean>
  
  <bean id="txMandatory" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
      <property name="transactionManager" ref="jmsTransactionManager"/>
      <property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_MANDATORY"/>
  </bean>
  ----
  
  Then we have routes, where each of the route use their different policy:
  
  [source,xml]
  ----
  <camelContext xmlns="http://camel.apache.org/schema/spring">
      <route>
          <from uri="activemq:queue:inbox"/>
          <transacted ref="txRequired"/>
          <to uri="direct:audit"/>
          <to uri="direct:order"/>
          <to uri="activemq:queue:order"/>
      </route>
  
      <route>
          <from uri="direct:audit"/>
          <transacted ref="txRequiresNew"/>
          <bean ref="auditLogService" method="insertAuditLog"/>
      </route>
  
      <route>
          <from uri="direct:order"/>
          <transacted ref="txMandatory"/>
          <bean ref="orderService" method="insertOrder"/>
      </route>
  </camelContext>
  ----
  
  Notice how the ref attribute on `<transacted>` refers to the corresponding bean id of the transaction policy.
  
  TIP: **Keep it simple:** Although you can use multiple propagation behaviors with multiple routes in Camel, do
  so with care. Try to design your solutions with as few propagations as possible, because
  complexity increases dramatically when you introduce new propagation behaviors
  
  
  == Transaction example with database
  
  