Create a java service
Create a private static object on the shared source (private static Object LOCK_OBJ = new Object(); )
Have the code below on the java service source: IDataCursor idc = pipeline.getCursor();
IDataCursor idcResult = null;
try {
// put this section into a critical section to ensure single-threaded execution
synchronized(LOCK_OBJ)
{
Execute a flow service using Service.doInvoke
}
idc.destroy();
idcResult.destroy();
} catch (Exception exc){
ServerAPI.logError(exc);
idc.destroy();
throw new ServiceException(exc.toString()); }\\