设置 Oracle 11g 会话超时

Setting Oracle 11g Session Timeout(设置 Oracle 11g 会话超时)
本文介绍了设置 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 会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)