title: SessionContext.getBusinessObject() in EJB3 & JNDI lookup
body: <p>In <strong>EJB2</strong>, one needed to use <em>getEJBBusinessObject()</em> method in a EJB to pass reference to itself when calling another (local/remote) bean.</p>
  
  <p>Does the same apply for <strong>EJB3</strong>?</p>
  
  <p>e.g.</p>
  
  <pre><code>@Stateless 
  public class MyBean implements MyBeanLocal { 
  
      @Resource private SessionContext sessionContext; 
  
      public void myMethod() { 
          OtherBeanLocal  otherBean = ...; // getting reference to other local EJB. 
          MyBeanLocal myBean =  sessionContext.getBusinessObject(MyBeanLocal.class); 
          b.aMethod(myBean); 
      } 
  
      // Edit: calling myMethodTwo() from inside of myMethodOne()
      public void myMethodOne() {  
          MyBeanLocal myBean =  sessionContext.getBusinessObject(MyBeanLocal.class); 
          myBean.myMethodTwo(); 
      } 
  
      public void myMethodTwo() { 
          ...
      } 
      ... 
  } 
  </code></pre>
  
  <p>Also, if I fetch my local bean using <em>getBusinessObject()</em> method, is it the same as if I use common <em>JNDI lookup</em>?</p>
  
  <p>I've tested both approach, and both work, but I'm not sure if bean object is processed the same way by the container.</p>
  
  <p><strong>Edit</strong>:
  Is fetching the reference to ejb itself, when calling myMethodTwo() from inside myMethodOne() of the same ejb, in EJB3, still needed? Is it allowed to call methods inside the same ejb through <strong>this</strong> reference?
  How will this address transactions, if I decide to use some?</p>