Gigaspaces/bestpractices — pull request #21 by kay (2012-04-17 17:09:03+00:00)
Title: Fixed a potential concurrency bug

Hi guys,

I was going through your documentation and stumbled across this page recommending the use of a utility class

http://www.gigaspaces.com/wiki/display/XAP8/Setting+Up+Your+First+Data+Grid

When I opened the link I spotted these problems. The concurrent hash map protects against concurrent access but this is not a replacement for transactions. In fact you do not need the concurrent hash map at all in this case because nobody is editing it outside of getSpaces. It's been replaced with a locking structure that guards transactional areas that need both maps.

Please review.