Announcement Announcement Module
Collapse
No announcement yet.
Spring/Hibernate connection pooling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring/Hibernate connection pooling

    I was just wondering how connection pooling is managed in spring/hibernate implementation. I know a direct hibernate implementation uses c3p0. Is this the case with spring? Do I have to explicitly configure pooling, or does spring just take care of it with its support for Hibernate? Thanks for helping this newbie!

  • #2
    You have to explicitly configure it. That's because you could use whatever DataSource you wanted, C3P0 is just one choice. Take a look at the Spring sample applications, it has some Hibernate in it complete with application contexts.

    Comment


    • #3
      I have my datasource configured in the applicationContext, and uses jndi to get the datasource. So is it safe to say at that point the app server is handling the pooling?

      Comment


      • #4
        If you are defining the datasource then you can also customize the number of connections, time-outs and the like.

        Comment


        • #5
          I have my datasource configured in the applicationContext, and uses jndi to get the datasource. So is it safe to say at that point the app server is handling the pooling?
          Yes. Spring allows you to use any DataSource implementation with Hibernate or any other supported ORM tool, as well as JDBC with Spring's JDBC abstraction.

          Comment

          Working...
          X