[jboss-user] [EJB 3.0] - Re: Updating instead of deleting

jazir1979 do-not-reply at jboss.com
Wed Dec 20 19:55:02 EST 2006


I have the same problem, a uni-directional one to many on a FK with CascadeType ALL.

I try to delete a parent entity A, and Hibernate tries to update the FK column on the child table B to null, rather than performing a delete.


  | DEBUG 21-12 10:51:52,375 (Log4JLogger.java:debug:84)  -Deleting collection: [A.B#A = [3, TestDataFactory OrgName - EGYM]]
  | DEBUG 21-12 10:51:52,375 (Log4JLogger.java:debug:84)  -about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
  | DEBUG 21-12 10:51:52,375 (Log4JLogger.java:debug:84)  -update B set msg_id=null where msg_id=?
  | Hibernate: update B set msg_id=null where msg_id=?
  | DEBUG 21-12 10:51:52,375 (Log4JLogger.java:debug:84)  -done deleting collection
  | DEBUG 21-12 10:51:52,375 (Log4JLogger.java:debug:84)  -Executing batch size: 1
  | DEBUG 21-12 10:51:52,390 (Log4JLogger.java:debug:84)  -about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
  | DEBUG 21-12 10:51:52,390 (Log4JLogger.java:debug:84)  -skipping aggressive-release due to flush cycle
  | DEBUG 21-12 10:51:52,390 (Log4JLogger.java:debug:89)  -Could not execute JDBC batch update [update B set msg_id=null where msg_id=?]
  | 



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

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



More information about the jboss-user mailing list