Hi Friends
I am new to
EJB . I need help for handling transaction in stateless session bean, I am explaning the situation.
I have 5 Containar managed EB's and from stateless session bean I am calling create method of these EB's. Now suppose in two tables records gets successfully inserted and say there is some problem while inserting record in 3rd table through 3rd EB, so this whole transaction should get rollback.
The <transaction-type> for session bean and all EB's is in ejb-jar.xml as follows:
<transaction-type>Container</transaction-type>
and <trans-attribute> for session bean and all EB's is :
<trans-attribute>Required</trans-attribute>
And I am using UserTransaction interface for handling transaction but the problem I am facing is if record inserted successfully in first two tables from respective EB and say prob in inserting record from 3rd EB so I am calling userTransaction's rollback method but its not rolling back. The data inserted in first two tables is already commited, it rollback only 3rd table data. It should not happen, My requirement is if the record is inserted in all 5 tables successfully then only transaction should get commited otherwise rollback.
Can you please guide me about this situation, how to handle transaction?
Thankx in advance.
Regards
Pankaj Raverkar