In database delete Session.flush() has to be called appropriately, to avoid foreign key conflicts in delete() request to the database