gpt4 book ai didi

java - hibernate - 连接挂起

转载 作者:行者123 更新时间:2023-11-30 11:57:59 25 4
gpt4 key购买 nike

我在我的应用程序中收到这些警告,并且需要很长时间才能获得数据库调用的响应,例如 10-15 分钟。但是它在响应时间很慢的情况下工作得很好,问题是这个相同的应用程序在我 friend 的机器上工作,具有快速的数据库调用,并且在相同的配置下没有挂起,即使它在我的机器崩溃之前也能工作。我无法弄清楚这个问题背后的原因

这是带有警告的日志

Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to TEST_DATABASE
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: SQL Warning: 0, SQLState:
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed database context to 'TEST_DATABASE'.
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: SQL Warning: 0, SQLState:
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to us_english
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: SQL Warning: 0, SQLState:
Aug 6, 2010 10:04:14 AM net.sf.hibernate.util.JDBCExceptionReporter logWarnings
WARNING: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed language setting to us_english.
Aug 6, 2010 10:10:04 AM org.logicalcobwebs.proxool.admin.StatisticsLogger statistics
INFO: 10:05:00 - 10:10:00, s:3:0.01/s, r:0:0.00/s, a:23.33ms/0.00

我的系统是

  • Ubuntu 9.04
  • Apache tomcat 5.5.27
  • hibernate 3
  • Ant 1.7.0
  • JDK 1.5.0_12
  • MyEclipse 7.5 作为开发工具。

最佳答案

根据各种来源,这些 SQL Warning: 5701(已更改的数据库上下文)和 5703(已更改的语言设置)是信息性的,应该被忽略(!)。

来自Thread: SQLstate(01000) vendor code(5701) :

The 'changed database context' message is just one of the chatty informational messages that SQLServer has historically returned to the client, which are universally ignored. The JDBC driver must make any non-exception DBMS message available via a SQLWarning. Ignore it unless you're surprised that your default database context is Madimak. The cause of the message is that the initial context of a new connection is actually master, until the DBMS changes it to the user's default context.

这在 ODBC and SQL Server (SQL Server 2000) - Connecting to a Data Source 中得到确认.

但我不确定缓慢与这些“警告”有关。以上我的理解是不是。

您真的可以显示您的连接字符串吗?以防万一,引用是Building the Connection URL .

关于java - hibernate - 连接挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3421119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com