Chris, thanks so much for the reply.

You're right, this got rid of the hibernate exception.  However I'm still 
missing something.  This is the code as it stands right now:


  | KidBean kid = parent.getKids().get(mappingIndex);
  | em.remove(kid);
  | 

But when I go to reference the parent again the kid is still there.  What's 
worse is that I noticed in the database a new entry has been created for the 
kid.  (So it's not the same one, but a new one, if you want to be technical - 
one with almost all the same properties.)  This is the DB table before the 
remove:


  | sa=> select * from tdm_user_mapping;
  |  mapping_id | user_id | entity_type | entity_id 
  | ------------+---------+-------------+-----------
  |         450 |     100 | group       |        50
  |         550 |     100 | group       |       100
  | 

and after, notice that one with mapping_id 550 is the one removed:


  | sa=> select * from tdm_user_mapping;
  |  mapping_id | user_id | entity_type | entity_id 
  | ------------+---------+-------------+-----------
  |         450 |     100 | group       |        50
  |         600 |     100 | group       |       100
  | 

Trying various combinations of em.refresh(parent), em.merge(parent) and 
em.find(Parent.class, parentId) result in either nothing happening or a new 
exception:


  | Caused by: java.lang.RuntimeException: 
  | org.jboss.tm.JBossRollbackException: Unable to commit, 
  | tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=michael-
  | litherlands-computer.local/112, BranchQual=, localId=112] 
  | status=STATUS_NO_TRANSACTION; - nested throwable: 
  | (javax.persistence.EntityNotFoundException: 
  | org.hibernate.ObjectDeletedException: deleted entity passed to persist: 
  | [org.me.KidBean#<null>])
  | 

So clearly I'm missing something else.  I'm sure it's just that my heads not in 
the right place.  Could I get another hint from anybody?

Thanks much,
Mike

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

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

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to