Re-read the spec. The spec states that only one thread may be allowed to run in a single stateless session bean instance at any one time. The code in Eric's example will work relyably in any compliant container.

Rajeshwar Rao V wrote:
No. As per EJB spec..
But Yes,ur code _may_ work fine with JBoss.
Is Jboss not following EJB spec?

-----Original Message-----
From: Eric Jain [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 10:45 PM
To: jboss-user
Subject: [JBoss-user] Stateless session beans


Are stateless session beans threadsafe, i.e does the following code behave
as expected?

  public class TestBean
    implements SessionBean
  {
    private int tmp;

    // should always return true
    public boolean f()
    {
      tmp = 1;
      boolean b = tmp == 1;
      tmp = 0;
      return b;
    }
  }


--
Eric Jain




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to