Hessian 类 SerializerFactory 是线程安全的吗?

发布于 2024-08-05 22:41:03 字数 131 浏览 3 评论 0原文

我想使用 Hessian (Java) 序列化,并且需要使用自定义序列化程序创建一个 SerializerFactory (以处理 BigInteger)。我可以创建其中之一并在线程之间共享它吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

伴梦长久 2024-08-12 22:41:03

如果您查看源代码,那么您可以注意到SessionFactory将创建的序列化器存储在HashMap中,而HashMap不是线程安全的对象。有一篇关于它的有趣的帖子

所以,你的问题的答案是“不”。

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".

川水往事 2024-08-12 22:41:03

看来这个问题已经修复了一段时间了。他们现在使用 ConcurrentHashMap。

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

04-06-07 15:16 ferg 已在版本中修复 => 3.1.1

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文