Hibernate 和 Oracle10g:Tomcat 超时
我在测试服务器上开发了一个 Web 应用程序,使用 Oracle10g 测试数据库,使用 Hibernate 3.6.0 进行 ORM。测试服务器上一切正常。
当我将此 Web 应用程序移至生产服务器和生产 Oracle10g 数据库时,我遇到了一个奇怪的问题:当我尝试在 Hibernate 中运行更新查询时,服务器超时(我收到内部服务器错误)。
这些是 Tomcat 记录的最后几行:
2011-05-03 15:45:09,083 DEBUG (org.hibernate.pretty.Printer:113) - fsmodule.model.Organization{organizationid=65, ogroup=fsmodule.model.Ogroup#5, nature=fsmodule.model.Nature#2, name=Norway, factsheets=<uninitialized>}
2011-05-03 15:45:09,083 DEBUG (org.hibernate.pretty.Printer:110) - more......
2011-05-03 15:45:09,091 DEBUG (org.hibernate.jdbc.AbstractBatcher:410) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2011-05-03 15:45:09,092 DEBUG (org.hibernate.SQL:111) - update RESPONSE set FACTSHEET_FACTSHEETID=?, QUESTION_QUESTIONID=?, TEXT=? where RESPONSEID=?
2011-05-03 15:45:09,099 DEBUG (org.hibernate.jdbc.AbstractBatcher:66) - Executing batch size: 1
...仅此而已!没有输出任何错误,没有其他任何内容。选择查询工作得很好,但插入查询也有同样的问题。 此外,我的用户告诉我,该应用程序一开始工作正常,然后就停止正常工作(在此期间我没有对 Web 应用程序进行任何更改)。
另请注意,如果我使用与 hibernate.cfg.xml 文件使用的凭据相同的凭据直接连接到数据库,我可以完美地更新行。
可能出了什么问题?
感谢大家一直以来的宝贵帮助。
I developed a web application on a test server, with an Oracle10g test database, using Hibernate 3.6.0 for ORM. Everything works fine on the test server.
When I moved this web application to the production server and the production Oracle10g database, I encountered a strange issue: the server times out when I try to run an update query in Hibernate (I receive an Internal Server Error).
These are the last lines logged by Tomcat:
2011-05-03 15:45:09,083 DEBUG (org.hibernate.pretty.Printer:113) - fsmodule.model.Organization{organizationid=65, ogroup=fsmodule.model.Ogroup#5, nature=fsmodule.model.Nature#2, name=Norway, factsheets=<uninitialized>}
2011-05-03 15:45:09,083 DEBUG (org.hibernate.pretty.Printer:110) - more......
2011-05-03 15:45:09,091 DEBUG (org.hibernate.jdbc.AbstractBatcher:410) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2011-05-03 15:45:09,092 DEBUG (org.hibernate.SQL:111) - update RESPONSE set FACTSHEET_FACTSHEETID=?, QUESTION_QUESTIONID=?, TEXT=? where RESPONSEID=?
2011-05-03 15:45:09,099 DEBUG (org.hibernate.jdbc.AbstractBatcher:66) - Executing batch size: 1
... and that's all! No error outputed, nothing else. The select queries work very well, but I have the same issue with the insert queries.
Moreover, my users told me that the application worked fine at first, and then it stopped working correctly (I did not change the web application whatsoever in the meantime).
Also note that if I connect directly to the database with the same credentials than the ones used by the hibernate.cfg.xml file, I can flawlessly update the rows.
What could be going wrong?
Thank you all for your always-precious help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你配置c3p0连接池了吗? http://community.jboss.org/wiki/HowToConfigureTheC3P0ConnectionPool
Have you configured c3p0 connection pool? http://community.jboss.org/wiki/HowToConfigureTheC3P0ConnectionPool