Hi again,

On Fri, Mar 8, 2013 at 10:10 AM, Roland von Herget
<[email protected]> wrote:
>> The real fix is:
>>
>> * Modify HectorUtils.java:
>> - change all "public static<K> void insertSubColumn..." to "public
>> syncronized static<K>..." (3 changes)
>> - change "public static<K> void deleteSubColumn" to " public
>> syncronized static<K> void deleteSubColumn" (1 change)
>>
>> And then you are just synchronizing the calls to the mutator.
>
> Yes, now I think this, too.

I'm reverting this... after reading java docs and googling around:
I think that will be wrong, because it locks the whole class (it will
take a lock on java.lang.Class's object). But we have to lock the
mutator. So if someone's using more than one CassandraClient instance
(or we add another mutator to CassandraClient in the future), there
will be unnecessary locks.
I think: whoever creates the mutator (which is CassandraClient here)
must lock it.

--Roland

Reply via email to