Qus:    How to limit a flow service executed only by one thread at a time?
Apr 22, 2012 07:07 1 Answers Views: 2269 Tomas
Prev Next
Answers (1)
Tomas Apr 22, 2012 07:07
Answer:  

 



  • 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();



Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect