Jboss4.05+EJB3+oracle的实体操作非常之慢问题请教
Jboss4.05+EJB3+Oracle
现写了一个简单的BBS:
freemarker+struts2---->EJB3----->DB。
出现如下问题,
1、所有SQL语句在程序中运行时间都很长,长的不可思议,拿到数据库中直接执行(pl/sql developer)非常快,,说明语句是没问题的,
2、怀疑DB连接问题,netstat -na观察服务器和客户端,都没问题,连接很正常。
3、怀疑JBOSS方面的配置问题,可单独写个例子,跑的欢的很,一点问题没有,速度奇快。
4、怀疑此程序问题,可此程序异常简单,
客户端是JSP,代码如下:
em.createQuery("select bf from bbs_forum bf where bf.forumtype=:Type and bf.forumstatu=:forumstatu").setParameter("forumstatu",forumstatu) .setParameter("Type", Type) .getResultList(); em.createQuery("select bf from bbs_forum bf where bf.forumtype=:Type and bf.forumstatu=:forumstatu").setParameter("forumstatu",forumstatu) .setParameter("Type", Type) .getResultList(); em.createQuery("select bf from bbs_forum bf where bf.forumtype=:Type and bf.forumstatu=:forumstatu").setParameter("forumstatu",forumstatu) .setParameter("Type", Type) .getResultList(); em.createQuery("select bf from bbs_forum bf where bf.forumtype=:Type and bf.forumstatu=:forumstatu").setParameter("forumstatu",forumstatu) .setParameter("Type", Type) .getResultList();return null;