ejb@glassfish.java.net

RE: EJB Stateful problem

From: Roman Pohodzhai <rpohodzhai_at_spline-software.com>
Date: Thu, 1 Nov 2007 15:37:21 +0200

 

 

From: Roman Pohodzhai [mailto:rpohodzhai_at_spline-software.com]
Sent: Thursday, November 01, 2007 3:36 PM
To: Kenneth.Saks_at_Sun.COM
Subject: RE: EJB Stateful problem

 

Hello once more!

It's very interesting for me J.

Suppose I've lookuped some stateful EJB twice, hence EJB container has
create two instances. My question is : "When this beans being destroyed,
passivated?".

It's interesting for me because when I look in monitoring section through
admin console I see that two instances are created but no instance is
removed or passivated. Why they are not removed, even after they can't be
used? And why they are still called STATEFUL?

 

 

From: Kenneth.Saks_at_Sun.COM [mailto:Kenneth.Saks_at_Sun.COM]
Sent: Thursday, November 01, 2007 2:48 PM
To: ejb_at_glassfish.dev.java.net; rpohodzhai_at_spline-software.com
Subject: Re: EJB Stateful problem

 

Roman Pohodzhai wrote:

Hello!

I have some problem with Glassfish V2 B58g and Stateful ejb's.

When I try to lookup any stateful bean from JNDI I always receive a new
instance of ejb. I expected one instance per session but receive new one.

Hi Roman,

That's the spec-required behavior. Each injection or lookup of a stateful
session bean results in a new instance with a unique identity. The current
specification does not define any Singleton behavior. That's a feature
under strong consideration for EJB 3.1.



 

Thanks in advance!

 

Sincerely,

Roman Pohodzhai

 

Spline-software : <http://www.spline-software.com>
http://www.spline-software.com
e-mail: rpohodzhai_at_spline-software.com

skype account : rpohodzhai