AW: Synchronizing ejb method

Andreas Berg <[email protected]> Mon, 15 May 2006 09:40:35 +0200
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------_=_NextPart_001_01C677F2.DA6C42B7
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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.
=20
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.
=20
Kind regards,
=20
Andreas.
=20
=20
Andreas Berg
Zelfi AG
Hechtsheimer Stra=DFe 33
55131 Mainz
Telefon: 06131-9064850
Telefax: 06131-9064853
[email protected]
http://www.zelfi.com/
=20

________________________________

Von: A mailing list for Enterprise JavaBeans development =
[mailto:[email protected]] Im Auftrag von Kalra, Ashwani
Gesendet: Montag, 15. Mai 2006 06:42
An: [email protected]
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
=20
=20

__________________=20
Regards=20
Ashwani Kalra=20


=20
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.

=09
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 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".=20


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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".


------_=_NextPart_001_01C677F2.DA6C42B7
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006>You shouldn't.&nbsp;The only reason&nbsp;to =
synchronize=20
a stateless session bean is if your bean is not stateless. Then ask =
yourself why=20
you chose a stateless bean for some stateful =
purpose.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006>If you really want to synchronize your SLSB =
you need to=20
think about the runtime environment. If all the instances of the SLSB =
run in a=20
single JVM, you can use the standard Java synchronization features =
inside the=20
bean to synchronize. But this doesn't work with a clustered environment. =
AFAIK=20
there is no standard approach to solve this.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006>Kind regards,</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D265003407-15052006>Andreas.</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#000000 =
size=3D2></FONT>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#808000 size=3D1>Andreas =
Berg<BR>Zelfi=20
AG<BR>Hechtsheimer Stra=DFe 33<BR>55131 Mainz<BR>Telefon:=20
06131-9064850<BR>Telefax:&nbsp;06131-9064853</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#808000 size=3D1><A=20
href=3D"mailto:[email protected]">[email protected]</A></FONT><=
/DIV>
<DIV align=3Dleft><FONT face=3DArial color=3D#808000 size=3D1><A=20
href=3D"http://www.zelfi.com/">http://www.zelfi.com/</A></FONT></DIV>
<DIV>&nbsp;</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Dde dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>Von:</B> A mailing list for Enterprise =
JavaBeans=20
development [mailto:[email protected]] <B>Im Auftrag von =
</B>Kalra,=20
Ashwani<BR><B>Gesendet:</B> Montag, 15. Mai 2006 06:42<BR><B>An:</B>=20
[email protected]<BR><B>Betreff:</B> Synchronizing ejb=20
method<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=3D087493904-15052006><FONT face=3DArial=20
size=3D2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=3D087493904-15052006><FONT face=3DArial size=3D2>The =
client of my ejb=20
can be an jsp or standalone java class.&nbsp; How can I synchronize =
access to=20
the SLSB ejb method? I am using ejb2.0 version</FONT></SPAN></DIV>
<DIV><SPAN class=3D087493904-15052006><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV>&nbsp;</DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=3Den-us><FONT face=3DArial =
size=3D2>__________________</FONT></SPAN>=20
<BR><SPAN lang=3Den-us><FONT face=3DTahoma =
size=3D2>Regards</FONT></SPAN> <BR><SPAN=20
lang=3Den-us><B><FONT face=3DTahoma size=3D2>Ashwani =
Kalra</FONT></B></SPAN> <BR></P>
<DIV>&nbsp;</DIV>
<TABLE>
  <TBODY>
  <TR>
    <TD bgColor=3D#ffffff><FONT color=3D#000000>This message contains =
information=20
      that may be privileged or confidential and is the property of the=20
      Capgemini Group. It is intended only for the person to whom it is=20
      addressed. If you are not the intended recipient, you are not =
authorized=20
      to read, print, retain, copy, disseminate, distribute, or use this =
message=20
      or any part thereof. If you receive this message in error, please =
notify=20
      the sender immediately and delete all copies of this=20
      =
message.<BR><BR></FONT></TD></TR></TBODY></TABLE>=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
To unsubscribe, send email to [email protected] and include in the =
body of=20
the message "signoff EJB-INTEREST". For general help, send email to=20
[email protected] and include in the body of the message "help".=20
<P></P></BODY></HTML>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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".
<p>

------_=_NextPart_001_01C677F2.DA6C42B7--