activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Transaction Boundry Spring DAO and Producer
Date Thu, 24 Aug 2006 07:35:43 GMT
On 8/23/06, javaxmlsoapdev <> wrote:
> In my service layer when I call DAO method to insert a record,
> subsequently(in the same logical block) I call producer to put a message in
> the queue. I need to bind this logical block in one transaction so that if
> insertion of a record fails, call to producer should not occur
> I am using Jencks. should Jencks transaction be used or Spring declarative
> transaction? Any example?

If you wire up your DAO to JTA then you just need to do a JTA rollback
to rollback the JDBC and JMS operations. So you should be able to
achieve this purely by using Jencks for both the JMS and JDBC. e.g.
see this example of creating a JDBC DataSource which is automatically
wired to the JTA transaction...

You could use spring's declarative transactions to do the
commit/rollback for you if you like.



View raw message