Hai, Could any one explain, Why we should not invoke resource-manager specific transaction methods(commit or rollback from java.sql.Connection) while TRANSACTION is Bean Managed ..?
Karan V Praba.
posted 13 years ago
Because such an attempt would interfere with the coordination provided by the transaction manager. Even though bean-managed demarcation makes you responsible for starting and completing a transaction, the container still handles the enlistment of resources in a transaction. Therefore, do not use any API provided by a resource manager. For example, if you are accessing a database or a JMS session, you cannot call commit or rollback on a java.sql.Connection or a javax.jms.Session.