Announcement Announcement Module
Collapse
No announcement yet.
Connection pooling with DriverManagerDataSource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connection pooling with DriverManagerDataSource

    I'm curious what performance side effects may occur if someone keep using in production spring's org.springframework.jdbc.datasource.DriverManagerD ataSource instead of commons-dbcp or c3p0.

    To be honest, I have no deep knowledge what lies beyond these pooling managers and I'd like to know what benefit they bring to the developer.

    And if the connection pooling is so important in production, why Sun/Oracle didn't introduced such a data source manager in the JRE?

  • #2
    DriverManagerDataSource isn't a connection pool... It opens and closes a Connection to the database when needed, that connection isn't pooled, if you use that in production you will probably run into performance issues with database access, because opening a connection is slow...

    So connection pooling is all about performance and managing(limit) the amount of connections to the database. THere is no general consensus on how to write a connection pool, some want a single threaded, some want multi threaded. For monitoring/compatibility J2EE vendors want to integrate one into their app server, database vendors want to utilize the possibilities of the underlying database... Which make it quite hard to create a commonly used connection pool.

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      [snip]
      Which make it quite hard to create a commonly used connection pool.
      thanks for reply.

      Speaking of two major alternatives: c3p0 and dbcp I found kinda spooky a fact that c3p0 still not reached version of 1.x, latest version is 0.9.1.2 on mvnrepository.com.

      Is it OK to use it in the new application or it'd be better to use dbcp?

      Comment


      • #4
        I suggest using neither... BoneCP or the new tomcat connection pool are IMHO better alternatives, more up to date and better maintained.

        Comment


        • #5
          Originally posted by Marten Deinum View Post
          I suggest using neither... BoneCP or the new tomcat connection pool are IMHO better alternatives, more up to date and better maintained.
          Ops, I see. Thanks for advice.

          Comment

          Working...
          X