get and set Attribute for EJB Context (Storing objects)  
Author Message
JehanNYNJ@aol.com





PostPosted: 2004-12-8 22:29:00 Top

java-programmer, get and set Attribute for EJB Context (Storing objects) Are there any methods like getAttribute and setAttribute off the EJB
Context object like there is for Servlet context?

Currently I did not see any in the API. How then are we supposed to
store objects that we want to exist for the life of the app server and
to be accesible by our beans?

Thanks for any suggestions.

 
JehanNYNJ





PostPosted: 2004-12-8 22:31:00 Top

java-programmer >> get and set Attribute for EJB Context (Storing objects) Are there any methods like getAttribute and setAttribute off the EJB
Context object like there is for Servlet context?

Currently I did not see any in the API. How then are we supposed to
store objects that we want to exist for the life of the app server and
to be accesible by our beans?

Thanks for any suggestions.

 
Michael Borgwardt





PostPosted: 2004-12-8 22:45:00 Top

java-programmer >> get and set Attribute for EJB Context (Storing objects) email***@***.com wrote:

> Are there any methods like getAttribute and setAttribute off the EJB
> Context object like there is for Servlet context?

Nope.

> Currently I did not see any in the API. How then are we supposed to
> store objects that we want to exist for the life of the app server and
> to be accesible by our beans?

Not at all. Such objects would not be compatible with the concept of EJBs,
which includes clustering.

You have to use entity beans for such purposes.
 
 
Collin VanDyck





PostPosted: 2004-12-9 6:27:00 Top

java-programmer >> get and set Attribute for EJB Context (Storing objects) email***@***.com wrote:
> Are there any methods like getAttribute and setAttribute off the EJB
> Context object like there is for Servlet context?
>
> Currently I did not see any in the API. How then are we supposed to
> store objects that we want to exist for the life of the app server and
> to be accesible by our beans?
>
> Thanks for any suggestions.
>

Could you use JNDI to store and lookup the objects like you would a
DataSource?