JAX-WS Web服务线程安全性和性能问题 [英] JAX-WS web services thread safety and performance concerns

查看:76
本文介绍了JAX-WS Web服务线程安全性和性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从其他几篇文章中了解到,并且我对JAX-WS Web服务的了解不是线程安全的.我的Web服务将被100个客户调用,我们需要能够处理大约200个事务/秒.

I understand from a few other posts and my understanding on JAX-WS web services they are not thread-safe. My web service is going to get called by 100's of clients and we need to be able to process around 200 transaction/second.

我的Web服务将与数据库交互以执行其工作,如果我在访问数据库的代码周围引入了synced关键字,那么我实质上将确保一次仅一个线程访问数据库,我想知道是否仍然在这种情况下能够达到所需的吞吐量.在此先感谢您的帮助.

My web service is going to interact with database to perform its work, if i introduce the synchronized keyword around the code that access the database I essentially will ensure only one thread access the database at a time, I wonder if I will still be able to achieve the required throughput in this case. thanks in advance for your help.

有人告诉我实际上将数据库访问工作移到另一个类中,并在方法级别实例化该类,这样我就不必使用synced关键字,并且仍然可以实现线程安全.正确吗?

I have been told to actually move the database access work into another class and instaniate that class at the method level that way I won't need to use the synchronized keyword and still achieve thread safety. Is that correct?

推荐答案

如果您需要事务处理和线程安全,为什么不仅仅使用EJB作为JAX-WS端点?

If you need transactions and thread safety why aren't you just using EJBs as your JAX-WS endpoints?

这篇关于JAX-WS Web服务线程安全性和性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆