• Post Reply Bookmark Topic Watch Topic
  • New Topic

delete records from database  RSS feed

Jim Carrey
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In our application I am working on a module wherein we allow user to delete the records from the database. They can select records to delete or just delete everything. The number of records could be more than 500000.

Here is part of the attachment.hbm.xml

Here is the code in the dao.

My question:
1. Is it the right way to delete huge number of records?
2. I get the following exception when I execute the above code.
ERROR org.hibernate.util.JDBCExceptionReporter - The DELETE statement conflicted with the REFERENCE constraint "FK_assignment_attachment". The conflict occurred in database "mydb", table "dbo.assignment", column 'att_id'.

Could someone provide me insights for this?


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!