• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to handle transaction in DAO

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I make DAO for USER. I make a new connection in each method(CRUD) of DAO. I want to know what is the best strategy to handle transaction in DAO pattern. How can i call another DAO from DAO class.
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the answer to your question lies in following questions:
1. Are you using EJBs in your application ?
2. Or any other framework like Spring/Hibernate etc.

Generally I have not seen DAO calling another DAO. DAO to me are specialized extensions of the business components (EJB or POJO), which contain data access code. I think it should be Business component calling another business component.

The transaction handling will come from the first two questions.
reply
    Bookmark Topic Watch Topic
  • New Topic