Hi all, I have to do transactions using DAO's. I decided to go for programmatic transaction demarcation to implement the transactions. But will the declarative or the container managed transaction demarcation would be better?. Since this is my first implementation I am not able to decide on. Please I need suggestions. And also I need some links where I can read about container managed DAO implementations.
If you declare a session bean as CMT it will start a transaction on entry of the public method and commit it on a good exit. If anything in the process sets "rollback only" it will roll back on exit. This works nicely 99% of the time for my project. We have a couple BMT that must commit part of the work before doing the rest of the work but the requirement that led us there is pretty weird.
Sfar as I know, those rules are the same regardless of what kind of db access structure you have ... SQL in the session bean or a DAO layer or CMP. So any good reference you can find on the details of CMT vs BMT should apply to your DAO. [ January 03, 2005: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi