设置 Oracle 11g 会话超时
重启服务器后,Tomcat服务器的oracle连接每晚都会超时.在重新启动之前,连接没有超时.现在,在早上,应用程序在访问数据库时抛出 JDBC 连接错误.重新启动 Tomcat 可以解决此问题.我假设这是由于重新建立了连接.我认为,这是由于 Oracle DB 会话超时所致.如何在 Oracle 11g 中禁用会话超时?
谢谢!
史蒂夫
After rebooting the server, the oracle connection from the Tomcat server times out every night. Prior to the reboot, the connection didn't timeout. Now, in the morning, the application throws a JDBC connection error while accessing the DB. Restarting Tomcat corrects the issue. I'm assuming that's due to the connections being re-established. I think, this is due to the Oracle DB timing out the session. How can the session timeout be disabled in Oracle 11g?
Thanks!
Steve
忽略开发和测试的 Config.groovy.
Config.groovy with dev and test omitted.
dataSource {
pooled = true
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
production {
dataSource {
driverClassName = "oracle.jdbc.driver.OracleDriver"
username = "XXXXX"
password = "XXXXXX"
dialect = "org.hibernate.dialect.Oracle10gDialect"
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:oracle:thin:@XXXXXX:1521:xxxx"
}
} }
推荐答案
这通常由与 Tomcat 连接的用户关联的配置文件控制.
That's generally controlled by the profile associated with the user Tomcat is connecting as.
SQL> SELECT PROFILE, LIMIT FROM DBA_PROFILES WHERE RESOURCE_NAME = 'IDLE_TIME';
PROFILE LIMIT
------------------------------ ----------------------------------------
DEFAULT UNLIMITED
SQL> SELECT PROFILE FROM DBA_USERS WHERE USERNAME = USER;
PROFILE
------------------------------
DEFAULT
所以我连接的用户有无限的空闲时间 - 没有超时.
So the user I'm connected to has unlimited idle time - no time out.
相关文章