Spring configuration of C3P0 with Hibernate?

后端 未结 2 1205
梦如初夏
梦如初夏 2021-01-02 05:23

I have a Spring/JPA application with Hibernate as the JPA provider. I\'ve configured a C3P0 data source in Spring via:



        
相关标签:
2条回答
  • 2021-01-02 05:49

    org.hibernate:hibernate-c3p0 looks like the module you would use if you were configuring Hibernate to use C3P0 directly.

    You shouldn't need it assuming the configuration you posted works for you - does it?

    0 讨论(0)
  • 2021-01-02 05:59

    The hibernate-c3p0.jar provides the class org.hibernate.connection.C3P0ConnectionProvider, a C3P0-based implementation of the Hibernate ConnectionProvider contract. You need this artifact when you want to use C3P0 as Hibernate's standalone connection pool (that you configure through the hibernate.cfg.xml file). Since you're using Spring, you don't need it.

    0 讨论(0)
提交回复
热议问题