`
gxh04007101
  • 浏览: 15132 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

collection is close

阅读更多
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
分享到:
评论

相关推荐

    LensPhoto数字近景摄影测统软件

    The world s leading digital close-range photogrammetry system software, 2007 edition, is worth collection.

    LEDA算法库

    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 ...

    Lithography [semiconductor mfg]

    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 ...

    a project model for the FreeBSD Project.7z

    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 ...

    微软内部资料-SQL性能优化5

    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 ...

    commons-collections4-4.1

    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 ...

    bookstore 网上书店源码

    preparedStatement.close (); ConnDB.terminate(); } catch(SQLException e){ e.printStackTrace(); ConnDB.terminate(); } return occupied; } public boolean isValidUser (String username, String ...

    微软内部资料-SQL性能优化3

    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 ...

    inventor学徒服务器Apprentice.pptx

    Inventor: differences Instantiated using "new ApprenticeServerComponent" No Documents collection in Apprentice Document object: ApprenticeServerDocument (*.ipt &*.iam) ApprenticeServerDrawingDocument...

    WizFlow网页编辑

    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. ...

    hibernate-shards.jar

    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. ...

    Agile Software Development Quality Assurance

    Agile methods are a collection of different techniques and practices that share the same values and basic principles. Agile Software Development Quality Assurance provides in-depth coverage of the ...

    inventor学徒服务器.pptx

    Inventor: differences Instantiated using "new ApprenticeServerComponent" No Documents collection in Apprentice Document object: ApprenticeServerDocument (*.ipt &*.iam) ApprenticeServerDrawingDocument...

    Universal-USB-Installer

    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 ...

    Accelerated C++: Practical Programming by Example

    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 ...

    Accelerated C++ Practical Programming by Example

    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 ...

    VB.NET Developer's Guide(4574).pdf

    collection is a group of objects whereby an array is a data type. 153_VBnet_TOC 8/16/01 1:12 PM Page xix xx Contents Displaying Modal Forms 288 Displaying Modeless Forms 289 Displaying Top-Most ...

    雷达技术知识

    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 ...

    Java邮件开发Fundamentals of the JavaMail API

    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...

Global site tag (gtag.js) - Google Analytics