1 Reply Latest reply on May 10, 2013 12:26 PM by Yogesh Upadhyay

    Accessing Node in Multithreaded Environment

    naveenks

      Hello Everyone,

       

      Can anybody tell me how safely can we access a node in multithreaded environment ?  In mine case I would have a nodes which will have a status as property with the value as pending, inprocess and complete. There would be multiple threads which can take a node and do some processing and change the status as pending and change it to inprocess and inprocess node status property can be changed to complete. But there could be a race condition so one way could be to use mutex locks when ever we are setting property but it would not be an efficient one becuase one is changing the property of a node and another thread is changing the property of an another node than in that case it would not be problem so no locks are necessary.

       

      As Jackrabbit itself provides locking and transactions. Can anybody tell me how can can i use this(locking and transaction) in mine case.

       

      Thanks,

      Naveen Shukla