I have 2 services:
- A service that writes to couchbase db using incr operation.
- A service that reads the written record.
I'm writing the second one in java and would like to use a pre-made decoder called LongTranscoder (net.spy.memcached.transcoders.LongTranscoder):
LongTranscoder lt = new LongTranscoder();
long result = couchbaseClient.get(myKey, lt);
My app is a multithreaded app and I would like to know if LongTranscoder is thread safe (meaning I can use a single static instance for all of my queries) or should I create an instance for each db query?
Looking at the implementation of LongTranscoder and TranscoderUtils it seems that there are no shared objects that can impose problems for multithreaded code, but I would like to be certain.
I'll be glad to get an extra point of view.