nuvolabase/orientdb — pull request #1301 by henryzhao81 (2013-01-22 22:20:14+00:00)
Title: Reduce risk for infinite loop

When initial OStorageSynchronizer, in class constructor, if found uncommitted records, it will call routeOperation2Node to synchronize with other servers for this #rid.
Check routeOperation2Node in OHazelcastPlugin, for iTask.call() if is local is master node will trigger to call call() function in OAbstractRecordDistributedTask.java.
In call() function, will getDatabaseSynchronizer(). Which wil check if OStorageSynchronizer instance is cached in HashMap or not, if not will create a new one and put into hashMap.
Due to the all the function call is synchrionzed. It will going to infinite loop to create OStorageSynchronizer instance.
Fix: due to OStorageSynchronizer constructor only triggered in getDatabaseSynchronizer() function in ODistributedAbstractPlugin.java, separate check uncommitted logic in different function, and triggered after instance be created and put to hashMap. If check uncommitted failed, the instance will be removed from hashMap which is the same to the origin logic