• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Transactions using DAO's

Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
Look ma! I'm selling my stuff!
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic