xiechunmei13 2009-09-24 12:15
浏览 279
已采纳

struts2+hibernate+spring+proxool性能问题

项目已经跑了2个多月了,今天突然出现不能访问的问题。
第一开始是访问一直刷不出页面,但是tomcat控制台却一下一下的在执行,(很慢的执行,很久才输出一条hibernate的语句)

之后将所有的应用重启了一次,
依然访问不了网站。

一直让他持续连接就会给我报错。
[code="java"]

2009-09-24 11:47:12 [org.logicalcobwebs.proxool.BESTVDB]-[WARN] #0008 was active for 1939871 milliseconds and has been removed automaticaly. The Thread responsible was named 'http-8080-Processor45', and the last SQL it performed is 'select iptvaction0_.action_id as action1_, iptvaction0_.uid as uid11_, iptvaction0_.username as username11_, iptvaction0_.con as con11_, iptvaction0_.cat as cat11_, iptvaction0_.friend_id as friend6_11_, iptvaction0_.friendname as friendname11_, iptvaction0_.code as code11_, iptvaction0_.state_id as state9_11_, iptvaction0_.remark as remark11_, iptvaction0_.datetime as datetime11_, iptvaction0_.allowed as allowed11_, iptvaction0_.visable as visable11_, iptvaction0_.action_place as action14_11_ from iptv_action iptvaction0_ where iptvaction0_.uid in (select iptvmyfrie1_.friendid from iptv_myfriends iptvmyfrie1_ where iptvmyfrie1_.uid=723) order by iptvaction0_.datetime desc limit 3; '.
2009-09-24 11:47:12 [org.hibernate.transaction.JDBCTransaction]-[ERROR] Could not toggle autocommit
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:985)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1113)
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4790)
at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:162)
at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
at com.mysql.jdbc.Connection$$EnhancerByProxool$$6a89ac94.setAutoCommit()
at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:174)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:122)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
[/code]

[code="java"]

javax.servlet.ServletException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed:
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)

root cause

org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed:
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541)
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)

root cause

org.hibernate.TransactionException: JDBC begin failed:
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:58)
org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24)
org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079)
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)

root cause

java.sql.SQLException: Couldn't perform the operation getAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
com.mysql.jdbc.ConnectionProperties$$EnhancerByProxool$$9313bf3c.getAutoCommit()
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49)
org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24)
org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)

[/code]
异常信息大概如上所示。
找不到头绪。
不知道该如何下手去优化?还是?
我该如何做?

这是我的第一个项目。还希望各位前辈给出指点!谢谢!

  • 写回答

1条回答 默认 最新

  • lianj 2009-09-24 18:00
    关注

    No operations allowed after connection closed.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀