Open and close on each request. For higher performance better have
some kind of connection pool like c3po
(http://http://sourceforge.net/projects/c3p0/) or apache commons dbcp
or whatever pooling your appserver has/supports.

Cheers,
Francis

On Tue, Aug 24, 2010 at 12:43 AM, exxos <[email protected]> wrote:
> Hi,
>
> Probably a "simple" question...
>
> For a web application, what is preferable?
>
> Keeping a DBDatabase instance opened (and attached to a driver)  in the
> application session (as static for example) or open and close it each time a
> db request?
>
>
> Regards,
> exxos.
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

Reply via email to