When sync-ing a 'hard' delete of the patient, exception is thrown "deleted object would be re-saved by cascade (remove deleted object from associations)" by hibernate's SessionImpl.forceFlush() method.
Additional info:
I've been debugging why hard delete of the patient doesn't work with sync code for doing deletes that I added in last week. It again throws exception stating that the object that was deleted is about to saved (because of associations to other objects) thus exception in thrown. As before, the exception is thrown because of the flush that is triggered when we do 'getOpenMRSObject' on the object we want to delete and as before deleting anything off patient seems to be very prone to this. This seems to be of no consequence as during deletes the only reason we are fetching a reference to the object is that we can turn around and delete it.
Anyway, while thinking what else can I possibly do about this, I found out we can manually turn off hibernate flushing for duration of deletes and it works just fine. I think suspending flushing during the deletes is the right solution but I am not sure if given how late in the game it is for 0.2 release, I am not sure we want to be doing this now.