Re: Struts and db connections :: best practice

2005-10-14 Thread Frank W. Zammetti
new DAOException(e.getMessage()); > }finally{ > //do cleanup... like closing connections etc. > } > } > > > regards > Leon > >> >> Do you catch this exception in the DAO method or do you throw it >> outside? >> When you throw it outside, the

Re: Struts and db connections :: best practice

2005-10-14 Thread Larry Meadors
regards > Leon > > > > > Do you catch this exception in the DAO method or do you throw it outside? > > When you throw it outside, the local connection will be unclosed. What do > > you to prevent such issues? Thanks in advance. > > > > > > > > > &

Re: Struts and db connections :: best practice

2005-10-14 Thread Ed Griebel
connections etc. > } > } > > > regards > Leon > > > > > Do you catch this exception in the DAO method or do you throw it outside? > > When you throw it outside, the local connection will be unclosed. What do > > you to prevent such issues? Thanks in adv

Re: Struts and db connections :: best practice

2005-10-14 Thread Leon Rosenberg
exception in the DAO method or do you throw it outside? > When you throw it outside, the local connection will be unclosed. What do > you to prevent such issues? Thanks in advance. > > > > > -- Forwarded message -- > From: Larry Meadors <[EMAIL PROTECTED]&

Re: Struts and db connections :: best practice

2005-10-14 Thread emre akbas
vance. -- Forwarded message -- From: Larry Meadors <[EMAIL PROTECTED]> To: Struts Users Mailing List Date: Thu, 13 Oct 2005 08:36:47 -0600 Subject: Re: Struts and db connections :: best practice I would argue that a well-written struts application will *never* (at least 99.

Re: [OT] Re: Struts and db connections :: best practice

2005-10-13 Thread Frank W. Zammetti
On Thu, October 13, 2005 12:37 pm, Dave Newton said: > Frank W. Zammetti wrote: > >> Everyone else raised completely valid points about not doing what your >> doing in an Action and why you shouldn't, so I'll just try and answer >> the question :) > > Thus ending a fine and noble tradition. > > Boo

[OT] Re: Struts and db connections :: best practice

2005-10-13 Thread Dave Newton
Frank W. Zammetti wrote: Everyone else raised completely valid points about not doing what your doing in an Action and why you shouldn't, so I'll just try and answer the question :) Thus ending a fine and noble tradition. Booo, Frank, bo! ;) Dave

Re: Struts and db connections :: best practice

2005-10-13 Thread Bryon Lape
I'm not sure about best practices, but I try to avoid database connections in my actions. I tend to put this code in the model objects and let them handle exceptions and so forth. > Hi all, > In a well written struts application, we assume declarative exception > handling is used. Therefore the c

Re: Struts and db connections :: best practice

2005-10-13 Thread Frank W. Zammetti
Everyone else raised completely valid points about not doing what your doing in an Action and why you shouldn't, so I'll just try and answer the question :) * Wrap your call to getConnection() in a try block with only a finally: try { Connection con = getDataSource().getConnection(); }

Re: Struts and db connections :: best practice

2005-10-13 Thread Vic Cekvenich
Best practice has nothing to do w/ struts. On Struts wiki there are several DAO's you can pick from. Struts allows MVC layers, so that you can unit test each layer. For example unit test the model and dao. Even w/in a DAO... you never use a connection. So I recommend you select a dao, and unit

Re: Struts and db connections :: best practice

2005-10-13 Thread DGraham
Am I experiencing DejaVu? Links that might interest you: http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html (see Figure 9.1) http://www.hibernate.org/ http://www.springframework.org/docs/ref

Re: Struts and db connections :: best practice

2005-10-13 Thread Larry Meadors
I would argue that a well-written struts application will *never* (at least 99.999% of the time) have jdbc code in it. Larry On 10/13/05, emre akbas <[EMAIL PROTECTED]> wrote: > Hi all, > In a well written struts application, we assume declarative exception > handling is used. Therefore the code