[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problem with CMP

vink do-not-reply at jboss.com
Wed Jun 3 00:05:33 EDT 2009


Hello,

My Scenario is as follows,
- I'm haivng 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

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 ..;
  |    }
  | }
  | 



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4234824#4234824

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4234824



More information about the jboss-user mailing list