Re: How to Catch WebApplication's Destroy()?

2011-07-26 Thread Martin Grigorov
org.apache.wicket.Application.onDestroy() On Tue, Jul 26, 2011 at 4:34 AM, eugenebalt eugeneb...@yahoo.com wrote: To clarify, this is not per-request, it should be per-application. I have a static Connection object in my WebApplication, and it's used for all transactions in the app. I

Re: How to Catch WebApplication's Destroy()?

2011-07-26 Thread Peter Ertl
1. I would recommend to use a connection pool, e.g. 'bonecp', 'c3p0' or 'dbcp' instead of a single connection. Using a single connection that stays connected to the db is a bad thing. You usually have to restart your web application when the database gets restarted (or goes offline for some

RE: How to Catch WebApplication's Destroy()?

2011-07-26 Thread Miroslav F.
@wicket.apache.org Subject: Re: How to Catch WebApplication's Destroy()? org.apache.wicket.Application.onDestroy() On Tue, Jul 26, 2011 at 4:34 AM, eugenebalt eugeneb...@yahoo.com wrote: To clarify, this is not per-request, it should be per-application. I have a static Connection object

Re: How to Catch WebApplication's Destroy()?

2011-07-26 Thread Martin Grigorov
:21 To: users@wicket.apache.org Subject: Re: How to Catch WebApplication's Destroy()? org.apache.wicket.Application.onDestroy() On Tue, Jul 26, 2011 at 4:34 AM, eugenebalt eugeneb...@yahoo.com wrote: To clarify, this is not per-request, it should be per-application. I have a static

How to Catch WebApplication's Destroy()?

2011-07-25 Thread eugenebalt
I have a DB connection that I initialize on WebApplication.init(), which I override. At the end, I need to close the DB connection in something like a destroy method for the app, but I couldn't find any overridable method for that. I tried overriding sessionDestroy() but it's not getting called

Re: How to Catch WebApplication's Destroy()?

2011-07-25 Thread eugenebalt
To clarify, this is not per-request, it should be per-application. I have a static Connection object in my WebApplication, and it's used for all transactions in the app. I construct it initially in the init(), and was just wondering where to close the Connection at the end of the app. -- View

Re: How to Catch WebApplication's Destroy()?

2011-07-25 Thread jcgarciam
Why not use a ServletContextListener http://download.oracle.com/javaee/5/api/javax/servlet/ServletContextListener.html Instead of using wicket for that? On Mon, Jul 25, 2011 at 10:34 PM, eugenebalt [via Apache Wicket] ml-node+3694614-1673249323-65...@n4.nabble.com wrote: To clarify, this is

RE: How to Catch WebApplication's Destroy()?

2011-07-25 Thread Miroslav F.
what I need from database and do all DB stufs - open connection, run SQL, close connection. -Original Message- From: eugenebalt [mailto:eugeneb...@yahoo.com] Sent: Tuesday, 26. July 2011 03:12 To: users@wicket.apache.org Subject: How to Catch WebApplication's Destroy()? I have a DB

Re: RE: How to Catch WebApplication's Destroy()?

2011-07-25 Thread Josh Kamau
are you prohibited from using a DI framework such as guice or spring? it can help you manage your object scope and lifecycle On 26 Jul 2011 07:41, Miroslav F. mir...@seznam.cz wrote: Bad. Wicket application start when you deploy it into Tomcat (it's time when WebApplication.init() is executed)

RE: RE: How to Catch WebApplication's Destroy()?

2011-07-25 Thread Miroslav F.
to Catch WebApplication's Destroy()? are you prohibited from using a DI framework such as guice or spring? it can help you manage your object scope and lifecycle On 26 Jul 2011 07:41, Miroslav F. mir...@seznam.cz wrote: Bad. Wicket application start when you deploy it into Tomcat (it's