We have a database that deals in large amounts of data. Previously we put high volume updates directly in jdbc and small complicated ones inside hibernate. Everything is mapped in hbm files, but we simply haven't been using hibernate for everything.
Now we're working on a large scale delete method and this has brought up an issue. We're trying to figure out whether to let hibernate do the delete or do a database side cascade delete. If we let the database do an internal cascade delete, then the hibernate second level cache won't know the deleted row or it's cascades has been deleted. Seems we'll either get an object not found exception or stale data.
Is there some way to combine cache with database side cascade deletes?
We're using SQL Server.
|