在使用C3P0的过程中出现了好多错误.最长见就是死锁,占用资源比较大.
对于死锁问题http://japi.iteye.com/blog/243702.找到了解决方案(不能完全保证,但在负载测试中,还没有出现问题)
问题关键是参数的设置
引用
<!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements
属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。
如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0-->
<property name="maxStatements">100</property>
<!--maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0 -->
<property name="maxStatementsPerConnection"></property>
解决的方法是:
引用
In hibernate.cfg.xml:
<property name="hibernate.c3p0.max_statements">0</property>
In c3p0.properties:
c3p0.maxStatements=0
c3p0.maxStatementsPerConnection=100
来源于:http://forum.hibernate.org/viewtopic.php?p=2386237
http://forum.hibernate.org/viewtopic.php?t=947246&start=0&postdays=0&postorder=asc&highlight=apparent+deadlock+c3p0&sid=6fcfab70cff3588bf010914df8dbbb90
http://www.mchange.com/projects/c3p0/index.html#c3p0_properties
分享到:
相关推荐
网上传言C3P0是因为本身的BUG问题,然而今天我遇到这个问题并解决了,结果发现并不是。通过配置c3p0.maxStatements=0 这种方案只是治标不治本,或者干脆无效。我上传的解决方案肯定能解决这个问题的根本原因。出现...
SQL Server上的一个奇怪的Deadlock及其分析方法
程序语言为Fortran,计算速度快,程序可改性也很强,欢迎学习电法的同行来下载!
能量流动方程运行能量流动分析。变量是文件名。读取系统数据。
神经网络中单离子通道问题的一篇很老的文章
数学模拟和实验研究不同衣下空气层厚度下的衣表温度,张昭华,王云仪,文章通过数值模拟和实验方法研究了衣下空气层厚度对服装表面温度的影响。用三维人体扫描仪测量了不同号型服装的衣下空气层分布。
表观太阳时间该应用程序可计算特定位置和时间范围内的太阳能数据。 它利用了和 。 为了运行此演示应用程序的实例,您需要生成自己的API密钥,并从~/config.js文件中导出它们: const geocodeApiKey = 'YOUR_OWN_...
Direction information of the palmprint provides one of the most promising features for palmprint recognition.... The method first extracts the apparent direction from the surface layer o
处理规则3D表面的外观轮廓,即法线与视图方向正交的表面点的观察者视图
使用的是函数requests.get(),已写header、cookie、User-Agent,也写了rsp.encoding = rsp.apparent_encoding。 但是仍是爬取不了。奇怪的同一个网站同一个榜单,只是页数不同,前若干页能爬取,后若干页就爬取不了...
The STPM01 is designed for effective measurement of active, reactive and apparent energy in a power line system using Rogowski coil, current transformer and shunt sensors. This device can be ...
表观 愚蠢的 Swift µFramework 用于 Swift 处理愚蠢的UIAppearance的愚蠢方式。
import requests from bs4 import BeautifulSoup import bs4 def getHTMLText(url): try: r = requests.get(url,timeout=30) r.raise_for_status() ...ulist.append(【tds[0】.string,tds[1].string,tds[3].string])
r.encoding = r.apparent_encoding return r.text except: return "" def fillUnivList(ulist, html): soup = BeautifulSoup(html, "html.parser") for a in soup.find('tbody').children: if isinstance(a...
│ └─第67讲 无功功率和视在功率(reactive power and apparent power) │ 0 第67讲 无功功率和视在功率(1).mp4 │ 1 第67讲 无功功率和视在功率(2).mp4 │ 2 第67讲 无功功率和视在功率(3).mp4 │ ├─第12周_ ...
Nowhere is that magic more apparent than in its LAB color processing capabilities, which can make even the subtle canyon colors of rock, sand, and dirt come to vivid life. However, you may be wary of...
P. Horn, B. G. Schunck 简述:Optical flow cannot be computed locally, since only one independent measurement is available from the image sequence at a point, while the flow velocity has two ...
python网络爬虫 ...1.Resquests库入门 1.get()方法:r=requests.get(url) ... r.apparent_encoding --从内容中分析出的响应内容编码方式(备选编码方式) r.content --HTTP响应内容的二进制形式 2.Requests的异常 reques
It is important to get these decisions right at the outset, because an incorrect choice may not become apparent until much later in the development process, at which point its rectification is often ...
because of its broad applicability and apparent simplicity. Its popularity has kept growing since, as testified by the hundreds of citations of the original article, and the ever more frequent use of ...