调试没问题,发布到服务器上一段时间报以下异常
org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:677)
问题原因:mysql 数据库将hibernate 连接给关闭了,
解决1:
在src目录下添加Proxool.xml文件与struts.xml hiberntate.xml同目录
DBPool
jdbc:mysql://localhost:3306/house
com.mysql.jdbc.Driver
10
select CURRENT_DATE
hiberante配置
org.hibernate.connection.ProxoolConnectionProvider
DBPool
Proxool.xml
true
update
org.hibernate.connection.C3P0ConnectionProvider
20
5
120
100
120
2
com.mysql.jdbc.Driver
admin
jdbc:mysql://********2
admin
admin
jdbc:mysql://localhost:3306/house
root
thread
org.hibernate.dialect.MySQL5Dialect
update
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
wait_timeout=1814400
# The TCP/IP Port the MySQL Server will listen on
port=3306