ejb@glassfish.java.net

Re: : stateful EJB

From: נחום מורדוכוביץ <nahummor_at_gmail.com>
Date: Thu, 14 Jan 2010 06:58:49 +0200

*I use two different browsers, IE8 and Chrome 3.0.195*
*about caching the stateful bean to HTTP session,*
*Is the server should do this ?*

*nahum
*
On Thu, Jan 14, 2010 at 06:50, Mahesh Kannan <Mahesh.Kannan_at_sun.com> wrote:

> Are you using browser tabs? Are you caching the ejb reference in HTTP
> Session?
>
> --Mahesh
>
>
> נחום מורדוכוביץ
> wrote:
>
>> *Thanks,*
>>
>> *I wrote a simple stateful ejb that store int number and two methods
>> getNumber() and setNumber(int x),*
>> i'm calling the ejb from two separate sessions (two browsers)
>> and if i set the number from first session i can see it from next session
>> by calling getNumber().
>> By your answer I understand it should not be so ?
>>
>> On Thu, Jan 14, 2010 at 03:26, Dies Koper <diesk_at_fast.au.fujitsu.com<mailto:
>> diesk_at_fast.au.fujitsu.com>> wrote:
>>
>> Ah, I (mis?)read it as "the same instance EACH time".
>> If so:
>>
>>
>> >> i get the same instance time ?
>>
>> No, a new EJB instance will be instantiated to serve your request.
>>
>>
>> >> Are every new session make a new instance of stateful ejb ?
>>
>> Yes. Stateless EJB instances are pooled (i.e. reused), but
>> stateful instances are not.
>>
>> Regards,
>> Dies
>>
>>
>>
>> On 14/01/2010 12:15, Marina Vatkina wrote:
>>
>> What is the instance time that you are looking at?
>>
>> thanks,
>> -marina
>>
>> נחום מורדוכוביץ wrote:
>>
>> *
>> *
>> *hi,
>> *
>> *I started recently to study EJB,*
>> I wrote a small program, a stateful ejb with two business
>> methods,
>> getX() and increaseX()
>> my question is whay when i call the ejb from more then one
>> session
>> (Different browsers)
>> i get the same instance time ?
>> Are every new session make a new instance of stateful ejb ?
>>
>> thank you
>> nahummor
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>> <mailto:ejb-unsubscribe_at_glassfish.dev.java.net>
>>
>> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>> <mailto:ejb-help_at_glassfish.dev.java.net>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>
>