0 Replies Latest reply on Jun 3, 2009 2:20 AM by vink

    Unable to persist after transaction completion

    vink

      Hello,

      My Scenario is as follows,
      - I'm having a main SLSB, which is placing a call to child SLSB
      - I'm getting some entities from child SLSB
      - I'm changing those entities
      - And, assuming that CMP will persist those entities

      Result,
      - Sometimes entities get perisisted
      - And, sometimes it doesn't

      Env: JBoss 4.2.3, PosgreSQL 8.3, Windows XP

      I'm not making use of merge(), as you can see from the dummy code shown below; I'm just changing the properties & leaving it to the container for persistence.

      Please suggest.

      Vinay

      @SLSB
      public class ProductBean
      {
       @EJB
       private ComponentBean mComponentBean;
      
       public void renameMyEntity(String anOldName, String aNewName)
       {
       MyEntity entity = mComponentBean.findMyEntity(anOldName);
      
       // change properties of MyEntity
       entity.setName(aNewName);
       }
      }
      
      @SLSB
      public class ComponentBean
      {
       public MyEntity findMyEntity(String aName)
       {
       return ..;
       }
      }