[jboss-user] [JBoss Seam] - Re: Batch removing, conversations and transactions managment

wschwendt do-not-reply at jboss.com
Mon Sep 17 09:44:19 EDT 2007


"v.masterov at gmail.com" wrote : 
  |  I need to delete multiple entities at once, while some of them have references to other entities. When I try to delete a group of entities without any references, the operation is successful. But if at least one of the entities in the batch has references, the transaction is rolled back entirely. 
  | 

Have you tried setting the cascade attribute in the annotations that define the relations between your entities? Eg. 

  | @OneToOne(cascade={CascadeType.REMOVE})
  | 

"v.masterov at gmail.com" wrote : 
  |  I am trying to delete entities using separate transactions for each entity, but still fail.
  | 

First of all, I think you're confusing transactions with conversations here.  

Secondly, why do you want to delete each entity within an own nested conversation?  

I assume your intention probably is that if the remove operation for one entity fails, it shouldn't lead to failure of the remove operations for all the other entities.     

Have you really investigated already whether an appropriate cascade remove setting for the relationships between your entities coulnd't solve your problem?


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

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



More information about the jboss-user mailing list