Results 1 to 2 of 2

Thread: Can't Roll Back ! EJB Transaction Management

  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Default Can't Roll Back ! EJB Transaction Management

    I am doing a project using Spring, JBoss, Struts and MySQL. It is a Electronic BillPayment and Remittence Web Application using J2EE.

    I got a problem of Transaction management of EJB, which is that I can't get operations rolled back if there is RuntimeException thrown.

    My project only use AbstractStatelessSessionBean to hold the business logic and use DAO to access the data source.

    There are two EJBs(CMP), one is BillPaymentEJB, another is RemittenceEJB. Both of them have some common business logic. So I want to put all common logic inside the Class TransactionOrderBean, which is not EJB, since I do not want to expose these logic to the Interface. Inside the method of BillPaymentEJB or RemittenceEJB(Transaction Required method), the method (This method will input some data into data source)of TransactionOrderBean will be invoked at the middle process of EJB method. Ideally, if there is RuntimeException thrown at the end of EJB method, all actions should be rolled back. But actually it does not roll back. Those two EJB will get the instance of TransactionOrderBean(Singleton) through the BeanFactory.

    Is there anyone could give me help about this? Thanks in advance

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    I assume you're using EJB CMT, rather than Spring transaction management. Your EJB container should be rolling back the transaction on an uncaught unchecked exception--Spring is not doing anything special here, so I suspect you have a misconfiguration in the EJB deployment descriptor.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Similar Threads

  1. Replies: 1
    Last Post: Sep 11th, 2005, 08:42 AM
  2. Hibernate - Transaction Doesnot roll back
    By amit_shah25 in forum Data
    Replies: 4
    Last Post: Mar 21st, 2005, 10:49 AM
  3. Transaction Management
    By caverns in forum Data
    Replies: 3
    Last Post: Mar 8th, 2005, 06:38 AM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •