Thank you, Daniel. You saved me. I synchronied objects before but didn't
synchronized such type as
public void setName(String name) {}. Thanks again,
Minger
----- Original Message -----
From: "Daniel Hinojosa" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 11:35 AM
Subject: Re: Multiple users share java bean?
>
>
> Chenming Zhao wrote:
>
> >Hi,
> >When two users call the bean almost at the same time, it seems that they
share the same object and their implementing is dependent with each other (I
hope they are independent), and cannot get correct results. Should I
configure Tomcat? I think the java bean is no problem. It's urgent. Please
help me.
> >
> >Minger
> >
> If it's a shared bean, sycnchronize it. Make sure that
> all mutators(Setters) are synchronized, and it would be a bad idea to do
> that to the
> accessors (mututors) are synchronized too. If you have more open than
> private member variables in this bean, make sure they are private.
> e.g.
>
> public void synchronized setName(String name) {
> .....
> }
>
> --
> Daniel Hinojosa
> Java & XML: Consultant | Developer | Instructor
> P.O. Box 4675
> Albuquerque, NM 87196-4675
> (505) 363-5832
>
>
>
>
>
>
> --
> To unsubscribe: <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>