David,

I think that people are trying to understand why you want to concern
yourself with threads, while inside of an EJB. EJB does not allow threads
inside of a bean, because that would affect the container's ability to
control the lifecycle of the bean.

The synchronized modifier is used to limit access to a code group to a
single thread. If there is only one thread at a time guaranteed to be acting
upon your bean (as it is in EJB), the use of synchronized will not achieve
anything, other than some unnecessary overhead in your code. Feel free to
use it if you wish.

jim

----- Original Message -----
From: David Olivares <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 10, 2000 2:02 PM
Subject: Re: having a PRIVATE synchronized method in a session EJB


> I guess my question was not very clear...
> here it goes again
> 1) is there any restriction against synchronizing?
> 2) if there is one, what is it?
>
>
> -----Original Message-----
> From: Kirk Pepperdine [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 11, 2000 1:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: having a PRIVATE synchronized method in a session EJB
>
>
> I believe the restriction is against threading.  Given this, there is
> no need to synchronize.
>
> Kirk
>
>
> -----Original Message-----
> From: David Olivares <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Monday, January 10, 2000 7:52 AM
> Subject: having a PRIVATE synchronized method in a session EJB
>
>
> >hi there,
> >I need to have a PRIVATE synchronized method in a session EJB. I know the
> specs don't allow me to have a synchronized methods in EJBs, but I'm not
> sure if having a PRIVATE synchronized method is also forbidden.  A way
> around this will be to have a helper class that does the synchronization
for
> me, which I think is allowed in the specs.
> >thanks in advanced
> >David :)
> >
>
>===========================================================================
> >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".

Reply via email to