Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is quite possible for the <code>@PreDestroy</code> method to not be invoked. The EJB 3.1 specification, explicitly states this:</p> <blockquote> <p><strong>4.6.3 Missed PreDestroy Calls</strong></p> <p>The Bean Provider cannot assume that the container will always invoke the PreDestroy lifecycle callback interceptor method(s) (or ejbRemove method) for a session bean instance. The following scenarios result in the PreDestroy lifecycle callback interceptor method(s) not being called for an instance:</p> <p>• A crash of the EJB container.</p> <p>• A system exception thrown from the instance’s method to the container.</p> <p>• <strong>A timeout of client inactivity while the instance is in the passive state.</strong> The timeout is specified by the Deployer in an EJB container implementation-specific way.</p> </blockquote> <p>The specification also details how resources may be removed if the <code>@PreDestroy</code> method is not invoked in such scenarios:</p> <blockquote> <p>For example, if a shopping cart component is implemented as a session bean, and the session bean stores the shopping cart content in a database, the application should provide a program that runs periodically and removes “abandoned” shopping carts from the database.</p> </blockquote> <p>In your case, it would depend on how you are storing the state of your reservations. If they are persisted in the database, then I would suggest employing the same approach as mandated in the specification. You could use the EJB Timer service, to perform this activity periodically, or use a scheduler like Quartz. Note, that it is imperative to distinguish between the contents of passivated session bean instances that no longer exist, and those that will be made ready once again.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload