Java EE 规范和多线程 [英] Java EE specification and multi threading
问题描述
我正在使用 Struts 和 Spring 编写 Java EE 应用程序.其中一项操作是繁重的数据库处理,因此存在性能问题.我想知道的是我可以在这里使用多线程吗?我认为 Java EE 规范不允许创建除服务器创建的线程之外的自定义线程(我使用 Weblogic).请指导我完成此操作.
I am writing a Java EE application using Struts and Spring. In one of the operations there is heavy database processing, and hence performance issues. What I want to know is can I use multithreading here? I think the Java EE specification does not allow custom threads to be created apart from those created by Server (I use Weblogic). Please guide me through this.
推荐答案
这个问题偶尔会弹出.
根据规范,它未经授权.最好看的页面是这个:Q/A: J2EE Restrictions
As per the spec it's not authorized. The best page to look at is this one: Q/A: J2EE Restrictions
也就是说,有很多方法可以生成线程,尤其是在 Weblogic 中使用 WorkManager
.
That said, there are ways to spawn threads, especiall in Weblogic with the WorkManager
.
查看这些问题:
第一个针对 EJB 的事实应该没有那么重要,而最后一个关于访问文件系统的事实是关于一般限制.
The fact that the first one targets EJB shouldn't matter that much, and the last one about access to file system is about general restrictions.
希望有帮助.
这篇关于Java EE 规范和多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!