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