Hi,
I have an issue in my service.
I am using EJB2.0 and using WSAD 5.1.2 for coding and
testing.
My handler class calls the method A in the Session Bean.
I can pass n number of actions in a single request which should go in a single transaction. In case of failure of any action all should be rolled back.
1. I have a method A being called form the client.
2. The method A inturn calls method B.
3. Method B performs Add or update or delete on a particular table in a database.
4. Before Adding or updating or deleting the data Method B needs to check whether the data send is valid or not.
5. So it calls Method C which checks for the data.
6. Method C has all the select statements and checks whether the data in the request is valid or not.
7. Method C while doing the checks connects to two different databases. And returns the data back to Method B.
8. Method B then checks for the flag send by method C and if the flag is true it has to roll back the previous transactions.
9. Else it will add or update or delete the data for that action
Now the problem is my request contains multiple actions. One single request can have multiple adds, multiple updates and multiple deletes.
If for example we have 3 adds 2 updates and 2 deletes
The first 3 adds are done successfully and 1 update done successfully and the second update fails then it has to roll back first 4 successful adds and updates to the database. Here I am facing an IllegalState Exception problem.
What should be the transaction attributes set to each method A, B and C
If I set A as not supported and B required and C Not supported then the connection to 2 different databases is working fine but in case of failure it cribs saying the same exception.
If I make A to Required and B to Required and C to NotSupported then it cribs with the same exception while connecting to 2 different databases.
Note: Method C should be NotSupported and The transaction type is Container Managed.
Can any one give me a solution to this problem.
Mark a reply to
vs_latha@ureach.com Regards,
Latha