Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #599 (new defect)

Opened 10 months ago

Last modified 10 months ago

Delete Patient does not work with sync.

Reported by: mcunderlik Assigned to: callen
Priority: major Milestone: Synchronization 0.3
Component: Synchronization Keywords:
Cc: Introductory Ticket:

Description

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.

Change History

02/04/08 23:55:52 changed by mcunderlik

  • milestone changed from Synchronization 0.2 to Synchronization 0.3.

There are additional issues with deleting patient with existing obs. Moving to 0.3 version. Will not use this functionality for 0.2.