ITeye博客

Hibernate在Resin下部署多个c3p0数据源

meiping · 2011-03-11 17:22 · Java · 编程语言 · Spring · Hibernate · Markdown

环境:

resin3.x

hibernate3

c3p0-0.9.1

 

单纯的使用hibernate,没有spring来配合,如果同一个resin下配置了多个c3p0连接池,则会报错,错误信息如下:

A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were close
d prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources.

 

解决的方法是在hibernate的配置文件中给session-factory取各不相同的名称

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。