Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

DAO pattern

Darshan

2004-11-18

Replies:

Hi,
Sorry. By mistaken i press send before completing the message last time.

I am having some doubt regarding the DAO pattern. We are using a handler
class to invoke methods in DAO class. Each method in the DAO class will
handle their own DB Connection and commit/rollback actions will be taken
care by each method.

 Suppose in an AccountDAO which is having two methods to handle Credit
and Debit functions. Two methods are handling commit/rollback actions
individually. These two methods are calling from a handler. My transaction
required two call these two methods and should be Atomic (ACID properties).
Because AccountDAO's methods are handling transaction individually, How can
i achieve my requirement.
 What about moving the transaction code to another class and call the
DAO's methods from thre.

Thanks in advance for your time.

Regards
Darshan

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.