I am using EJB 2.0 for coding my business logic and use entity beans for persistence.
But I have few business methods in stateless session beans, which uses JDBC queries.
I am using the default transactional attribute "Required".
The connection are retrieved from the data source deployed in the application server.
My concept(s) regarding JDBC when it is used in EJBs are:
1. When connection is retrieved from data source in EJB method, the executed SQL
queries form part of the transactions initiated by the container for the EJB method.
2. When a system exception is thrown the transaction will be rolled back by the container.
Now the issue is that the transaction rollback is not happening if SYSTEM exception is thrown in between.
I tried setting the attribute to "RequiresNew" for the EJB method to initiate new transaction, but still not working.
Could anyone point out, whether my understanding is right, or what I am doing wrong.