db connection pooling

greetings,

i have a question regarding connection pooling.

i am developing a simple vaadin portlet for liferay in eclipse. it accessing a postgres db (using TableQuery in SQLContainers) via a SimpleJDBCConnectionPool.

the problem i have noticed is that as i develop → deploy → develop → redeploy, etc… in eclipse, the number of connections to my postgres db increases in step with the number of times my portlet is deployed. what i suspect is happening is that when the previous portlet is un-deployed, the connection pool stays and keeps the connections in the pool open. further, restarting the liferay portal server cleans these connections up.

is there a way, from within the vaadin portlet to detect that it is being un-deployed and handle the connection pool at that point?