Check out ECperf:
http://java.sun.com/j2ee/ecperf/
And see Akara Sucharitakul's article (specifically "rule 2"):
http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules/
Akara is the or one of the lead engineers on the ECperf app, and he's
implemented this DAO pattern in it in many of the EJBs. Look for classes
ending in *DAO.java -- those are the DAO classes for the EJB in whichever
package you're looking at.
The DAO's lookup resources through the standard J2EE means, namely JNDI. So
if your server supports data sources and connection pooling,
UserTransaction, and so on, you do not need to implement your own pooling,
transactions, etc. anymore than you would in a regular BMP bean. For
example, in ECperf the DAO instances are embedded in their associated BMP
beans, and the BMP methods just delegate to the DAO. If you download and
check out the ECperf source, you will see immediately how it works.
Scott Stirling
JRun QA
Macromedia
> -----Original Message-----
> From: Jeetendra [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 05, 2001 11:25 AM
> To: [EMAIL PROTECTED]
> Subject: [EJB-INT] Data Access Object Pattern for J2EE
>
>
> Hello All,
>
> I was just reading Data Access Object pattern. It recommends
> abstracting the
> database access logic in a seperate class. The servlet, JSP,
> Session bean
> and Entity Bean (BMP) would use this class. However this
> would not be used
> if we used Container Manager Persistence
>
> Now if the Data Access Objects are simple classes,
> understandably they are
> not managed by the Container.
> Hence we need to implement connection pooling and manage
> transaction across
> the application.
>
> I am not able to appreciate the use of this. Could someone
> please throw some
> light on this.
>
> Thanx a lot
> Jeetendra
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".