Process instance Modification throws Optimistic locking exception

I have suspended the process instance and before activate i would like to modify the process instance. The modification involves moving token a activity before where it is suspended. I get optimistic locking exception. Could someone help me with this?

ActivityInstance ai = runtimeService.getActivityInstance(piId);

@Sowmiya can you upload your bpmn file? and in which activity you are starting at?

infinite.bpmn (4.1 KB)

Did you find a solution to this problem? I seem to be having a similar problem with process instance modification.