0

It looks like EclipseLink is closing the connection before the shutdown hook executes. (I am not 100% sure but from my experiments it looks that way.) I need to do something inside the shutdown hook, so I need to prevent EclipseLink to close the connection. As an example for clarification, in Log4j I can do it using this directive in the XML config file:

<Configuration shutdownHook="disable">

Is there something like this for EclipseLink?

1 Answers1

0

EclipseLink needs to close connections and resources when an EntityManagerFactory is closed or finalized, so it maybe that you are closing the last factory or it is getting finalized before your shutdown hook executes. The only way to prevent this would be to keep a reference to a factory in your shutdown hook so it doesn't get closed or garbage collected before it completes.

Chris
  • 20,138
  • 2
  • 29
  • 43