Hi,

IMHO create two EJBs, one Stateless and one Stateful
and create a normal Java class with the functionality
you desire.

For the Stateful Session Bean place the Java class as
a member variable of the EJB and deligate the required
calls to it.

For the Stateless Session Bean you can also put the
Java class as a member variable of the EJB class but
you have to be really carefull you do not store any
state in the class as you will get very quickly into
threading issues.  If this state is an issue you will
have to have the Java class as a method variable.

David

--- Dimitar Stavrakov <[EMAIL PROTECTED]>
wrote:
> Hi Subhendu,
>
>         Maybe it would be a good idea to use 2 ejbs,
> one for the statefull
> scenario, and one for the stateless scenario.
>
>         Regards,
>                 Dimitar
>
> -----Original Message-----
> From: subhendukumar mohanty
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 12, 2002 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Stateful session bean thread issue
>
> Hi,
>
> I have designed a Stateful bean , which is required
> to be statefull in one
> of my scenario. In other scenario i does not care
> about the state , so i
> want to invoke the methods on it. So if user clicks
> in a link wich invokes
> the first scenario, which creates the statefull
> bean. If at the same time
> user clicks some other link which invokes only the
> method of the same bean
> it  gives error.
>
> Is there any suggestion to design this type of
> scenario??
>
> Thanks,
> Subhendu
>
> -----Original Message-----
> From: Ashwani Kalra [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 11:59 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Stateful session bean thread issue
>
>
> Hi,
> Why do you need concurrent access to the the bean.
> If you still need, then
> put the calls to the bean in the synchronised block.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Thanks
> Ashwani Kalra
> http://www.geocities.com/ashwani_kalra/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans
> development
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> subhendukumar mohanty
> Sent: Friday, April 12, 2002 12:52 AM
> To: [EMAIL PROTECTED]
> Subject: Stateful session bean thread issue
>
>
> Hi,
>
> I am using stateful session bean in my project. When
> one of the thread tries
> to access one of the method of the bean when another
> thread is using some
> other method of the bean , it gives ejbreeentrant
> exception.
>
> I would like to know why it is happening and how to
> prevent second thread
> from using the bean when other thread is accessing
> it.
>
> Thanks,
> Subhendu
>
> =========================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff EJB-INTEREST".  For general
> help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff EJB-INTEREST".  For general
> help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
>
>
==========================================================================To
> unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff EJB-INTEREST".  For general
> help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff EJB-INTEREST".  For general
> help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
>


=====
David J. Jones, <[EMAIL PROTECTED]>,
Virgin Mobile USA,
8th Floor,
22 Fourth Street,
San Francisco,
CA, 94103,               Work: 415 932 5470.
USA.                     Fax:  415 358 4999.


=====
David J. Jones, <[EMAIL PROTECTED]>,
Virgin Mobile USA,
8th Floor,
22 Fourth Street,
San Francisco,
CA, 94103,               Work: 415 932 5470.
USA.                     Fax:  415 358 4999.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to