Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pool - Own implementation / DBCP / c3p0

 
kri shan
Ranch Hand
Posts: 1460
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have our own connection pool implementation. I am thinking of implementing connection pool using DBCP / C3P0. Can we get better performance using DBCP / c3p0 than our own connection pool implementation ?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote: Can we get better performance using DBCP / c3p0 than our own connection pool implementation ?

Probably. Your implementation is highly unlikely to be optimized (or bug free for that matter.)
 
Scott Selikoff
author
Saloon Keeper
Posts: 4008
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This falls under the category of 'reinventing the wheel'. There are people spending a lot of time and energy building things like database connection pools and unless you have a strong belief these implementations are flawed, better to use their work.

Reminds me of an old programmer adage... "Good programmers write good code, great programmers steal good code. "
 
Wallace Wadge
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:We have our own connection pool implementation. I am thinking of implementing connection pool using DBCP / C3P0. Can we get better performance using DBCP / c3p0 than our own connection pool implementation ?


You might want to have a look at BoneCP - according to my benchmarks, available on the site, it's faster than both C3P0 and DBCP.

Disclaimer: I'm the author so I can't be unbiased

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic