Discussion:
Transaction management & hibernate
Laurence Weil
2012-02-08 12:53:43 UTC
Permalink
Hi,

I've configured a flow that starts a transaction on receiving a message, the message is passed off to a component which transforms & saves the message into a temporary store using hibernate.

Finally a webservice is called to run some business processes.

If the webservice fails I want the data that was saved in the component to be rolled back. However I'm not finding a way of getting this to work yet.

My config is as follows:

<flow name="ProcessDDIRecordCreate">

<inbound-endpoint ref="ddiRequest">
<jms:transaction action="ALWAYS_BEGIN" />
</inbound-endpoint>

<component>
<method-entry-point-resolver>
<include-entry-point method="transformAndSave" />
</method-entry-point-resolver>
<spring-object bean="transformer" />
</component>

<outbound-endpoint ref="businessProcessWebservice" exchange-pattern="request-response">
<cxf:jaxws-client serviceClass="an.other.BusinessProcess" operation="runUpdateProcess" />
</outbound-endpoint>

<default-exception-strategy>
<rollback-transaction exception-pattern="*"/>
<outbound-endpoint ref="error" />
</default-exception-strategy>
</flow>

The following error is printed out:


WARN JmsTransaction - Transaction rollback attempted, but no resource bound to ***@bc8fc985-524b-11e1-9c17-e51694736e2c[status=STATUS_MARKED_ROLLBACK, key=null, resource=null]

Have tried this with the XA tx manager as well and no joy.

My hibernate transaction is marked up in the transformer class using the @Transactional annotation.

How can I get my component class to take part in the transaction?

Thanks

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Laurence Weil
2012-02-08 13:53:58 UTC
Permalink
Seems that jira MULE-5990 answers my question. i.e. mule does not currently support this.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Pablo La Greca
2012-02-08 21:57:33 UTC
Permalink
Take a look at [1] look for interactWithExternal.

I'm not sure but it might be possible to configure inbound endpoint as ALWAYS_JOIN and before executing inbound endpoint create an external XA transaction. Depends on how you are using mule.

HTH, Pablo.

[1] http://www.mulesoft.org/documentation/display/MULE3USER/Transaction+Management#TransactionManagement-XATransactions

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...