Re: EJBean's member variables shared?
Monday, April 29, 2002 12:31 PM
sure they are shared. entity EJB is truly shared meaning for a given entity bean identified by a prim key, any client accessing the bean is actually hitting the same EJB object. this is different from session beans where a session bean always services a single client at one time, stateful obviously since it is a client's extension on the server while stateless, even though they are pooled, actually service one client at any given time. therefore, an instance variable in an entity bean is shared between all clients for a given bean. but this is not static. if the variable was static, all client of all entity beans of the same type (with different prim keys) would share the same variable. if instance variable was not static, only clients accessing the same entity bean with one prim key would share that instance variable. hope I was clear enough in the explanation.