EJB和同步 [英] EJB and Synchronization

查看:104
本文介绍了EJB和同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

会话Bean(无状态会话bean,有状态会话bean)是否同步?

解决方案

一次只有一个线程将访问您的bean。由应用服务器来管理这一点。所以你不应该在你的bean中使用synchronized。这就是为什么一个非线程安全的EntityManager可以是实例值,而不是同步问题。


Are Session Beans (stateless session beans, stateful session beans) Synchronized?

解决方案

Only one thread at a time will be accessing your beans. It is up to the application server to manage this. So you should not be using synchronized from within your beans. This is why a non-threadsafe like EntityManager can be an instance value and not have synchronization issues.

这篇关于EJB和同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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