You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2013/10/08 12:13:02 UTC

Using transaction process

Hi.

In the xml description of the process can be written as



<reference id="osgiPlatformTransactionManager"
  interface="org.springframework.transaction.PlatformTransactionManager"/>

 
<bean id="required"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
  <property name="transactionManager" ref="osgiPlatformTransactionManager"/>
  <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
</bean>

<camelContext id="doc-read"
xmlns="http://camel.apache.org/schema/blueprint">
  <route id="receiptDoc">
    <from uri="direct-vm:receiptDoc"/>
    <transacted ref="required"/>
    ...
  </route>
</camelContext>

In the local RouteBuilder necessarily need to be registered and to specify
the alias object

from("direct-vm:receiptDoc")
  .id("receiptDoc")
  .transacted("required")
  .log("hellow");

Why can not we use the object directly, as in my example?

org.apache.camel.spi.Policy required = new
org.apache.camel.spring.spi.SpringTransactionPolicy();

from("direct-vm:receiptDoc")
  .id("receiptDoc")
  .transacted(required)
  .log("hellow");

Just use the ready-made object constructor

public TransactedDefinition(Policy policy)



Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Using-transaction-process-tp5741121.html
Sent from the Camel - Users mailing list archive at Nabble.com.