[转帖]weblogic连接超时问题解决方案_Tomcat, WebLogic及J2EE讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Tomcat, WebLogic及J2EE讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 4062 | 回复: 0   主题: [转帖]weblogic连接超时问题解决方案        下一篇 
smile
注册用户
等级:少校
经验:889
发帖:70
精华:2
注册:2013-4-22
状态:离线
发送短消息息给smile 加好友    发送短消息息给smile 发消息
发表于: IP:您无权察看 2013-4-28 9:02:03 | [全部帖] [楼主帖] 楼主

WebLogic连接池配置数据库断掉后自动重连设置
进入某个连接池配置页,进入“连接“页,点击高级选项的”show“显示高级选项。

指定 “测试频率” 并启用 “测试保留的连接”、”测试创建的连接” 和 “测试释放的连接”。

测试频率(Test Frequency): 60 秒

自动数据库连接测试之间的秒数(0 - 32 位正整数)。测试失败的连接将被关闭,然后重新打开以重新建立有效的物理数据库连接。(必须在下面指定测试表名称。)

The number of seconds (between 0 and a positive 32-bit integer) between automatic database connection tests. Connections that fail the test are closed and reopened to re-establish a valid physical database connection. (You must specify a Test Table Name below.)


测试保留的连接(Test Reserved Connections)

指定 WebLogic Server 是否在将连接提供给客户端之前测试该连接。(必须在下面指定测试表名称。)

Specifies whether WebLogic Server tests a connection before giving it to the client. (You must specify a Test Table Name below.)


测试创建的连接(Test Created Connections)

指定 WebLogic Server 是否在创建连接后且将该连接添加到缓冲池中可用连接列表之前对该连接进行测试。(必须指定测试表名称。)

Specifies whether WebLogic Server tests a connection after creating it but before adding it to the list of connections available in the pool. (You must specify a Test Table Name.)


测试释放的连接(Test Released Connections)

指定 WebLogic Server 是否在将连接返回到该 JDBC 连接缓冲池之前测试该连接。(必须指定测试表名称。)

Specifies whether WebLogic Server tests a connection before returning it to this JDBC connection pool. (You must specify a Test Table Name.)


连接保留超时(Connection Reserve Timeout): 设为 30 秒

在保留缓冲池连接的调用超时之前的秒数(-1 - 32 位正整数)。如果设置为 -1,则调用永远不会超时。

The number of seconds (between -1 and a positive 32-bit integer) after which a call to reserve a connection from the pool will timeout. When set to 0, a call will never timeout. When set to -1, a call will timeout immediately


重试创建连接的频率(Connection Creation Retry Frequency): 设为 30 秒 尝试建立与数据库的连接的间隔秒数(0 - 32 位正整数)。适用于在数据库不可用的情况下服务器启动时创建的连接缓冲池。

The number of seconds (between 0 and a positive 32-bit integer) between attempts to establish connections to the database. Applies to connection pools created at server startup when the database is unavailable.


钝化连接超时(Inactive Connection Timeout):

The number of inactive seconds on a reserved connection (between 0 and a positive 32-bit integer) before WebLogic Server reclaims the connection and releases it back into the connection pool.


服务器申请复议连接并且保留返回给连接池前的钝化时间

测试表名称(Test Table Name):

oracle的连接池默认为 SQL SELECT 1 FROM DUAL,sybase数据库可以填入一个记录不多的配置表名例如sys_code。

The name of the database table to use when testing physical database connections. This field is required when you specify a Test Frequency and enable Test Reserved Connections, Test Created Connections, and Test Released Connections.


上一篇介绍了其中一种设置方法,下面写一下,如果设置weblogic session的超时时间以控制weblogic连接超时问题:

1 web.xml


设置WEB应用程序描述符web.xml里的元素。这个值以分钟为
单位,并覆盖weblogic.xml中的TimeoutSecs属性

54


此例表示Session将在54分钟后过期
当设置为-2,表示将使用在weblogic.xml中设置的
TimeoutSecs这个属性值。
当设置为-1,表示Session将永不过期,而忽略在
weblogic.xml中设置的TimeoutSecs属性值。
该属性值可以通过console控制台来设置

2 weblogic.xml


设置WebLogic特有部署描述符weblogic.xml的元素的
TimeoutSecs属性。这个值以秒为单位

TimeoutSecs 3600


默认值是3600秒

3,jsp中控制

session.setmaxinactiveinterval(7200);


session是默认对象,可以直接引用,单位秒s

4,servlet中控制

httpsession session = request.getsession();
session.setmaxinactiveinterval(7200);


单位秒s

在weblgoic的console中:xxDomain->Servers->xxServer->Protocols->HTTP 中有一个关于Post Timeout的配置,但这个参数一般使用默认值即可

一般是通过Services–>JDBC–>Connection Pools–>MyConnection(你所建立的连接池名)-->Configration–>Connections 里的Inactive Connection Timeout这个参数来设置的,默认的为0,表示连接时间无限长。你可以设一个时间值,连接超过这个时间值,它会把连接强制放回连接池

CompleteMessageTimeout="480" IdleC
ListenAddress="" ListenPort="7001" Name="myserver"
NativeIOEnabled="true" ReliableDeliveryPolicy="RMDefaultPolicy"
ServerVersion="8.1.4.0">


是否IdleConnectionTimeout参数

看连接池中高级选项内的Inactive Connection Timeout和Connection Reserve Timeout时多少, 把这两项设大些试试!!




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论