users@glassfish.java.net

Re: Singleton _at_PreDestroy application state?

From: Steven Siebert <smsiebe_at_gmail.com>
Date: Thu, 22 Sep 2011 15:01:46 -0400

Im not entirely certian of your requirements, but using @PreDestroy isnt
always going to be called ie not in a graceful shutdown scenario. If the
JVM crashes, say with a heap space issue, you probably wont be notified.

An alternate apptoach could be to setup a polling/heartbeat (or use a
cluster software such as shoal or hazelcast to do this) in you application
code or monitor your application (the later can also use the gf rest or jmx
interfaces for gf or your own bean too,depending on what you are trying to
achieve).
 On Sep 22, 2011 2:36 PM, <forums_at_java.net> wrote:
> This seems like a bug - can you come up with a test case that reproduces
it
> and file it?
>
> You can write a record to a database as a work around...
>
>
>
> -marina
>
>
> --
>
> [Message sent by forum member 'mvatkina']
>
> View Post: http://forums.java.net/node/844344
>
>