Perry,

Greetings from he dark side (evil vendor here ;-).

You don't mean that each client has a reference to the same SSB instance do
you? That should not happen.

If an underlying helper object is shared, then you will have to code
"synchronized" calls around things that need to mutex. The container should
synchronize at the bean level, but what you do at the helper class level is
not under the control of the container.

I believe the spec says you can't or shouldn't do this, but since the code
is not in a bean, the container can't really check that you are doing
synchronize calls. There is no way (that I know of) to hook security control
at that level.

So basicically, you are on your own in terms of synchronizing access to
non-beans. Think carefully about the implications if the beans were to be
distributed across multiple server JVMs, which will be the case in a
clustered or scaled up environment.

<vendor>
GemStone/J's PCA gives you a way to shared state across beans. PCA objects
are transactional in the J2EE sense, so the synchronization issues are
mitigated to a degree.
</vendor>

-Chris.

> -----Original Message-----
> From: Perry Hoekstra [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, July 17, 2000 3:39 PM
> To:   [EMAIL PROTECTED]
> Subject:      Multi-Threaded Protection within a SSB
>
> Greet the sun all,
>
> I have a question dealing with multi-client access to a Stateless
> Session Bean.  I have an SSB that holds onto a collection of work steps,
> each step an instance of a Java helper class.
>
> Client A makes a request against the SSB.  Internally, the request is
> processed against the series of worksteps in the collection.
> Client B makes a request against the SSB.  Again, the request is
> processed against the series of worksteps in the collection.
>
> If each request makes the same method call on the same helper instance
> at the same time (good possiblity with a large number of clients), is
> there any protection from one request stepping on the other as long as
> the helper method called accesses no instance variables within the
> helper class?  Do I have the possibility of concurrent accesses to the
> helper method stepping on each other within the method?
>
> I did not get a good handle on an answer in Monson-Haefel's book nor did
> a search on the archives really address this question.
>
> Thoughts?
>
> --
> Perry Hoekstra
> Consultant
> Talent Software Solutions
> [EMAIL PROTECTED]
>
> ==========================================================================
> =
> 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