On 8/23/06, javaxmlsoapdev <[EMAIL PROTECTED]> 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... http://jencks.org/Outbound+JDBC You could use spring's declarative transactions to do the commit/rollback for you if you like. -- James ------- http://radio.weblogs.com/0112098/
