You shouldn't. The only reason to synchronize
a stateless session bean is if your bean is not stateless. Then ask yourself why
you chose a stateless bean for some stateful purpose.
If you really want to synchronize your SLSB you need to
think about the runtime environment. If all the instances of the SLSB run in a
single JVM, you can use the standard Java synchronization features inside the
bean to synchronize. But this doesn't work with a clustered environment. AFAIK
there is no standard approach to solve this.
Kind regards,
Andreas.
Andreas Berg
Zelfi AG
Hechtsheimer Straße 33
55131 Mainz
Telefon: 06131-9064850
Telefax: 06131-9064853
Zelfi AG
Hechtsheimer Straße 33
55131 Mainz
Telefon: 06131-9064850
Telefax: 06131-9064853
Von: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED] Im Auftrag von Kalra, Ashwani
Gesendet: Montag, 15. Mai 2006 06:42
An: EJB-INTEREST@JAVA.SUN.COM
Betreff: Synchronizing ejb method
Hi,
The client of my ejb
can be an jsp or standalone java class. How can I synchronize access to
the SLSB ejb method? I am using ejb2.0 version
__________________
Regards
Ashwani Kalra
This message contains information
that may be privileged or confidential and is the property of the
Capgemini Group. It is intended only for the person to whom it is
addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message
or any part thereof. If you receive this message in error, please notify
the sender immediately and delete all copies of this
message. |