I'm getting a DataSource through JNDI and passing that to my DAO to get a connection. This all happens inside a Stateless session bean. I was wondering, if some sort of error occurs during my database process(when I use my DAO), is transaction supported during this phase? I mean, would my transaction rollback?
Originally posted by Timothy Sam: if some sort of error occurs during my database process(when I use my DAO), is transaction supported during this phase?
Which transaction mechanism you are using? Anyway, you can do the dollowing:
1) Use CMT for the session bean method, 2) Put your bean method code in a try catch, 3) Throw exception from teh dao methods explicitly in case of issues / exception received, 4) In bean methods catch you can call setRollBackOnly on context object.
Hope this solves your problem.
Anirban<br /> <br />SCJP 1.4, SCWCD 5, SCBCD 5
I can't take it! You are too smart for me! Here is the tiny ad: