设置Oracle 11g会话超时 [英] Setting Oracle 11g Session Timeout

查看:367
本文介绍了设置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.

这篇关于设置Oracle 11g会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆