What if you do this:
public class DbShutdownImpl implements DbShutdown, RegistryShutdownListener
{
@Inject
private HibernateSessionSource sessionSource;
private final static Logger LOG =
Logger.getLogger(DbShutdownImpl.class);
@PostInjection
public void
Subclass TapestryFilter, map your class instead of Tapestry's in web.xml
and override destroy(Registry registry).
There you can use something like:
DbShutdown dbShutdown = registry.getService(DbShutdown.class);
// add this new method and close the database there
dbShutdown.shutdownDatabase();
same error, different service which can't be injected.
On 29/11/2010 8:13 PM, Tom van Dijk wrote:
What if you do this:
public class DbShutdownImpl implements DbShutdown,
RegistryShutdownListener
{
@Inject
private HibernateSessionSource sessionSource;
private final static Logger
Thanks Javier,
this sounds like it would work, but then it also doesn't sound very
'tapestry-ish' and if it's the only way to achieve this, shows a bit of
a hole in the tapestry/tapestry-ioc implementation...
is there a better solution?
On 29/11/2010 8:17 PM, Javier Molina wrote:
Subclass
On Mon, 29 Nov 2010 03:28:09 -0200, Paul Stanton p...@mapshed.com.au
wrote:
Hi all,
Hi!
I'm using tapestry-hibernate and an embedded HSQLDB database.
Another suggestion: why don't you use a non-embedded HSQLDB database while
developing? That's what I do when I use HSQLDB. Or launch a
thanks thiago, that would work too... however if using a embedded hsqldb
in production the same problem would occur...
in order to solve my case, it's probably simpler to just create a new
jdbc connection for shutdown (without hibernate support).
however i'm intrigued that there's no ability
Which service would that be? Could you provide a stack trace?
Perhaps you could make your service contribute to RegistryStartup as well,
to make sure the DbShutdownImpl service is realized and that the
sessionSource is realized. The startupService would then be the registry
startup method.
I
Overriding the filter might look ugly, but it was designed for that; see
the comments on destroy() and destroy(Registry registry).
You might find it less ugly to have a ServletContextListener and do the
cleanup in contextDestroyed.
The real solution would be to have a
Well, designed or not, I suppose overriding the filter is not a modular
solution. You can't add a third party library and expect it to work,
instead the application developer needs to do additional work by
modifying web.xml and on top of that, if you use your service without
tapestry-core, it
Javier,
I agree re registryIsShuttingDown .. that is what i'm looking for.
something that is called after new httprequests have been stopped, but
before the registry becomes broken.
there would need to be some ordered configuration to control the process
however.
i'm guessing this doesn't
Hi all,
I'm using tapestry-hibernate and an embedded HSQLDB database.
As you might know, it's important to tell HSQLDB to shutdown when you
are terminating the vm.
You do this by executing a proprietary SQL query SHUTDOWN before
closing your last connection.
Ideally I'd like to use
11 matches
Mail list logo