http://www.iteye.com/topic/14474
经测试,将maxActive和maxIdle设为100/30,能承载更大的压力(需要更大的并发数才重现这个问题)。把它们设成3/3或更小,就极容易重现。
经查资料,(一)的出现是因为代码中出现这种情况:从jndi获得数据库连接,没有在使用完返还数据库(调用close方法)。
经上设置,这样的连接,在经过removeAbandonedTimeout这个超时时间后,dbcp会自动回收,并把申请该资源时的调用栈信息log出来。
(根据其log的stacktrace查代码,发现俺们数据库连接都规规矩矩的关掉了)
但是,依照我的log信息,似乎这样解释(又有想不通的地方):
并发数达到maxActive值的时候,再提交请求,就会log出(一),并返回一个连接,但这个连接.isClosed()是true,不能拿来用(faint!)
于是就出现了(二)的异常。 总结一下,(一)处是log信息,可以通过logAbandoned设为false禁止。(二)处为异常。
查看hibernate关于dbcp的配置,有:
引用
#当连接池中的连接已经被耗尽的时候,DBCP将怎样处理( 0 = 失败, 1 = 等待, 2= 增长)
hibernate.dbcp.whenExhaustedAction 1
而dbcp的官方文档没有whenExhaustedAction这一配置项。又见有人说hibernate的dbcp和apache commons的dbcp不大一样,俺不清楚。
我们系统没有用到hibernate.
总结:
通过配置dbcp,可以提高稳定性。
问题:
DBCP在超maxActive后到底是什么行为?
如何通过系统配置进一步提高稳定性?
如何处理上述怪现象?
http://topic.csdn.net/u/20090206/23/fcb94d20-c996-4e00-9951-966a509c849d.html
分享到:
相关推荐
The world s leading digital close-range photogrammetry system software, 2007 edition, is worth collection.
The data type graph allows to write programs for graph problems in a form close to the typical text book presentation. LEDA is implemented by a C++ class library. It can be used with almost any ...
DBMS_OUTPUT.PUT_LINE(emp_in_dept_collection(i).ename || ' ' || emp_in_dept_collection(i).job || ' ' || emp_in_dept_collection(i).hiredate || ' ' || emp_in_dept_collection(i).sal); END LOOP; CLOSE ...
representation of all lithographic arts, it does represent a good collection of contributions in this field. We hope readers will enjoy reading the book as much as we have enjoyed bringing the book ...
`<dynamic>` 标签是最常用的动态 SQL 标签之一,它可以包含其他子标签,并支持 `prepend`, `open`, `close` 属性。 - **`prepend`**:此属性表示在动态生成的 SQL 语句前添加的内容,默认情况下会被自动移除第一个...
Ports is the collection of meta-data that is needed to make software packages build correctly on FreeBSD. An example of a port is the port for the web-browser Mozilla. It contains information about ...
Lesson 4: Information Collection and Analysis 61 Lesson 5: Formulating and Implementing Resolution 75 Module 6: Troubleshooting Query Performance Overview At the end of this module, you ...
Transforming decorators that alter each object as it is added to the collection Composite collections that make multiple collections look like one Ordered maps and sets that retain the order elements ...
preparedStatement.close (); ConnDB.terminate(); } catch(SQLException e){ e.printStackTrace(); ConnDB.terminate(); } return occupied; } public boolean isValidUser (String username, String ...
Lesson 4: Information Collection and Analysis 63 Lesson 5: Concepts – Formulating and Implementing Resolution 81 Module 4: Troubleshooting Locking and Blocking Overview At the end of ...
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. ...
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. ...
Source Code is made available at time of download, from the official UUI page: http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/ IMPORTANT! No Warranty is being offered with this ...
That’s the approach that’s offered by Accelerated C++, a text that delves into more advanced C++ features like templates and Standard Template Library (STL) collection classes early on. This book ...
That's the approach that's offered by Accelerated C++, a text that delves into more advanced C++ features like templates and Standard Template Library (STL) collection classes early on. This book ...
其属性如`item`、`index`、`collection`、`open`、`separator`和`close`分别控制迭代过程。 关于`collection`属性的特殊情况: - 当参数是单个`List`时,`collection`应设为`list`。 - 当参数是数组时,`...
However, where the angle of incidence is close to nadir (i.e. the LiDAR pulse is fired near perpendicular to water surface plane), light is reflected and provides elevations off the water surface ...
their activities, including their huge collection of FAQs at jGuru.com . To send feedback to jGuru about this course, send mail to producer@jguru.com . Course author: Formerly with jGuru.com , John...