Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delete records from database

 
Jim Carrey
Greenhorn
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?

Thanks

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic