You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kalle Korhonen <ka...@gmail.com> on 2009/12/17 05:58:00 UTC

Missing registryIsGoingToShutdown notification

I need to properly close an embedded database. There's
RegistryShutdownListener but it only receives registryDidShutdown()
event. I'm using Hibernate and I'd prefer using the database
configuration given to Hibernate rather than establishing a separate
connection just to shut it down, but the proxies won't work anymore
since registryDidShutdown happens after the fact (as the name
implies). Looking at the source of RegistryImpl, it seems like it
would be almost trivial to add another notification to the interface,
something like registryIsGoingToShutdown to notify services before the
registry shuts down. Would others think this is useful and/or is there
a better way to achieve the same?

Kalle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Missing registryIsGoingToShutdown notification

Posted by Kalle Korhonen <ka...@gmail.com>.
Then again, you'd have to be pretty careful about not doing any
shutdown in registryIsGoingToShutdown - I see why the existing rule
for didShutdown (don't use other services during shutdown) makes
sense. In this case though, probably easiest to decorate
HibernateSessionSource with the relevant logic.

Kalle


On Wed, Dec 16, 2009 at 8:58 PM, Kalle Korhonen
<ka...@gmail.com> wrote:
> I need to properly close an embedded database. There's
> RegistryShutdownListener but it only receives registryDidShutdown()
> event. I'm using Hibernate and I'd prefer using the database
> configuration given to Hibernate rather than establishing a separate
> connection just to shut it down, but the proxies won't work anymore
> since registryDidShutdown happens after the fact (as the name
> implies). Looking at the source of RegistryImpl, it seems like it
> would be almost trivial to add another notification to the interface,
> something like registryIsGoingToShutdown to notify services before the
> registry shuts down. Would others think this is useful and/or is there
> a better way to achieve the same?
>
> Kalle
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org