About Question enthuware.oce-ejbd.v6.2.462 :
Moderator: admin
About Question enthuware.oce-ejbd.v6.2.462 :
In the answer (explanation) is "(...)has been designated as a Removemethod(...)",
should be:
"(...)has been designated as a Remove method(...)".
should be:
"(...)has been designated as a Remove method(...)".
-
- Site Admin
- Posts: 10326
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
This has been fixed.
Thank you for the feedback!
Thank you for the feedback!
If you like our products and services, please help us by posting your review here.
-
- Posts: 33
- Joined: Mon May 02, 2011 5:09 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
Hi,
from explanations:
An ejb acquires resources in PostCreate (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
should be:
An ejb acquires resources in PostConstruct (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
from explanations:
An ejb acquires resources in PostCreate (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
should be:
An ejb acquires resources in PostConstruct (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
-
- Posts: 25
- Joined: Sun May 13, 2012 1:39 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
Hi Paul,
I need one doubt here... Please help me...
"Remember:
An ejb acquires resources in PostConstruct (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
If a bean is passivated and if the timeout occurs, the container does not call the PreDestroy method."
Here, I remember reading somewhere that, if SystemException occurs then also PreDestroy method is not invoked. In such scenarios we have to do cleanup in lifecycle event callback interceptors. Am I correct? Please clarify.
I need one doubt here... Please help me...
"Remember:
An ejb acquires resources in PostConstruct (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
If a bean is passivated and if the timeout occurs, the container does not call the PreDestroy method."
Here, I remember reading somewhere that, if SystemException occurs then also PreDestroy method is not invoked. In such scenarios we have to do cleanup in lifecycle event callback interceptors. Am I correct? Please clarify.
-
- Site Admin
- Posts: 10326
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
PreDestroy is a life cycle call back listener method and it is not called in case of system exception.prakashyaji wrote:Hi Paul,
I need one doubt here... Please help me...
"Remember:
An ejb acquires resources in PostConstruct (and PostActivate) callback methods and it releases the same resources in PreDestroy (and PrePassivate) methods.
If a bean is passivated and if the timeout occurs, the container does not call the PreDestroy method."
Here, I remember reading somewhere that, if SystemException occurs then also PreDestroy method is not invoked. In such scenarios we have to do cleanup in lifecycle event callback interceptors. Am I correct? Please clarify.
As per Section 4.6.3 of EJB 3.1 specification:
HTH,The application using the session bean should provide some clean up mechanism to periodically clean up the unreleased resources.
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.
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 31
- Joined: Sun Oct 13, 2013 1:20 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
I once read in a book that every stateful session bean should have at least one method with @Remove. But I cannot find it in the spec, so can anyone confirm that my statement is true or false?
-
- Site Admin
- Posts: 10326
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
As per section 4.3.11:
So, it is not mandatory but used commonly so that the bean can do any cleanup while being removed.A stateful session bean written to the EJB 3.x API typically has one or more remove methods designated by means of the Remove annotation or remove-method deployment descriptor element.
If you like our products and services, please help us by posting your review here.
-
- Posts: 31
- Joined: Sun Oct 13, 2013 1:20 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.462 :
Good to know, thanks!
Who is online
Users browsing this forum: No registered users and 3 guests