简体   繁体   中英

Is the Hessian class SerializerFactory thread-safe?

I'd like to use the Hessian (Java) serialization and need to create a SerializerFactory with custom serializers (to handle BigInteger ). Can I create one of these and share it among threads?

If you look at the source code , then you can notice that SessionFactory stores created serializers in a HashMap, and HashMap is not a thread-safe object. There is an intresting post about it.

So, the answer to your question is "no".

It appears this has been fixed for a while now. They now use ConcurrentHashMap.

http://bugs.caucho.com/view.php?id=1588

04-06-07 15:16 ferg Fixed in Version => 3.1.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM