Hi
i am trying to
test the Container Managed tranaction and the problem is that the part of hte transaction succeeds and part of the transaction fails. As you can see below i have two method saveCustomer and saveCustomerLog whose transaction state is defined as Required. On the
ejb side when i call the saveCustomer method i get a datasource by looking at the JNDI and do some insertion in that table and close the statement and connection.(Note: i dont do explicit commit here with connection object). then i call again the method saveCustomerLog on the same bean again get the datasource and do some insertion in some other table. The problem is that i wantedly put some error in the second call so that the entire transaction should fail but the first goes fine and the second part fails.
Here is the descriptor for the transaction part
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CustomerTrans</ejb-name>
<method-name>saveCustomer</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>CustomerTrans</ejb-name>
<method-name>saveCustomerLog</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
Please let me know if i am missing anything
Thanks in advance
Rashid