且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java EE应用程序中的线程死锁

更新时间:2023-12-04 08:15:16

从EJB 3.1规范,第21.2.2节。编程限制:

From the EJB 3.1 spec, Chapter 21.2.2. Programming Restrictions:


企业bean不能使用线程
同步原语到
同步执行多个
实例,除非它是具有bean管理的
并发的Singleton
会话bean。

An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances, except if it is a Singleton session bean with bean-managed concurrency.

推理也很有意思:


如果
EJB容器跨多个JVM分布企业
bean的实例,则同步将不起作用。

Synchronization would not work if the EJB container distributed enterprise bean’s instances across multiple JVMs.