当你使用hibernate.cfg.xml时,是否有任何理由保留c3p0.properties文件? [英] Is there any reason to keep around a c3p0.properties file when you use hibernate.cfg.xml?

查看:167
本文介绍了当你使用hibernate.cfg.xml时,是否有任何理由保留c3p0.properties文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的项目使用Hibernate(3.3.2)和c3p0作为我们的连接池。有一段时间,似乎c3p0.properties文件中有一些c3p0属性,而hibernate.cfg.xml中有一些属性。我刚刚将最后两个c3p0属性移到了hibernate.cfg.xml中,并确认它们正在受到尊重。

Our project uses Hibernate (3.3.2) with c3p0 as our connection pool. For a while, it seems there were some c3p0 properties in a c3p0.properties file, and others in hibernate.cfg.xml. I've just moved the last two c3p0 properties into hibernate.cfg.xml and confirmed they are being respected.

当c3p0属性可以在hibernate.cfg.xml中指定时,是否有任何理由保留c3p0属性文件?比如存在一个不能在那里配置的属性,或者我没有想到的另一个原因。在我看来,在两处指定c3p0属性只会引起混淆,

Is there ANY reason to keep around the c3p0 properties file, when c3p0 properties can be specified in hibernate.cfg.xml? Such as there being a property that can't be configured there, or another reason I'm not thinking of. It seems to me that specifying c3p0 properties in two places just causes confusion,

我认为之前有人认为某些属性无法在hibernate.cfg中传递.xml,我认为这只是一个神话。这是造成这个问题的主要原因。

I think there was a previous belief that some properties couldn't be passed through in hibernate.cfg.xml, which I expect is just a myth. That is the primary reason for this question.

推荐答案

不,没有理由。 (我什至没有hibernate.cfg.xml - 一切都在春季配置)

No, no reason. (I don't even have hibernate.cfg.xml - everything is in the spring configuration)

这篇关于当你使用hibernate.cfg.xml时,是否有任何理由保留c3p0.properties文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆