DAO 's factory is right or not! URGENT 2004-07-15 - By Ben Hill
Back > -- --Original Message-- -- > From: Manish Malhotra [mailto:manish.mmalhotra@(protected)] > Sent: 15 July 2004 10:47 > To: J2EE-INTEREST@(protected) > Subject: Re: DAO's factory is right or not! URGENT > > > Thanks Ben, > > Means I can implement something like connection / thread pool > for DAO's. And yes you are right that there is no performance > by DAO caching. But just the Factory pattern I intorduced. So > that there wod be less dependency between Beans & DAO's.
The factory pattern isn't dependant on storing the DAO in a map. The point I tried to make is that you only ever have *one* DAO in the map.
> > And Im not able to identify the methods of DAO which needs to > be synchropnized. Ir there any property which I need to look > in to the methods to identify.
It's arguably safer to have one DAO per request, so maintaining a pool of DAOs and serving one out per request helps. The more thread-safety that you can design into a system, generally the better.
> > Im calling som private methods also in DAO and passing the > connection object from one methods to another. Is there any > issue in this?
Without looking at the code, I'm not sure - but you shouldn't hold on to a connection for any longer than need be, and passing it about can leave it unreleased if it gets held somewhere...
Cheers,
Ben
********************************************************************
This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you
Check us out at http://www.btsyntegra.com
********************************************************************
==========================================================================To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|