• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connection pooling/threading

 
Ranch Hand
Posts: 35
MyEclipse IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a difference between setting up a db connection through tomcat (using the tomcat config ) and building one internally into a servlet? I'm looking to improve the performance of my project and am uncertain which path to take. Also, does the tomcat configuration affect how threading within servlets are handled? ( If so, does Pro Jakarta Tomcat 5 cover these issues? ) Thanks!
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setup db connection through app server will create a pool of that connections. In servlet you must do this manualy.

Which performance you mean? Is your application slow or consumes much resources?
 
Aodhan Hoffman
Ranch Hand
Posts: 35
MyEclipse IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for my application, for each request it handles, it must make several sql queries. Sometimes multiple JDBC connection objects are created in the cycle of the request. I'm thinking of threading the sql queries to improve speed.

Regarding threading, what I want to know is whether how the container is set up, the Tomcat configuration, might impact the threading of my application.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The biggest issue I see with using the containers connection pooling is with portablility.

The code to create a good connection pool is fairly trivial and small. This being the case, why would I want to reduce my flexabiltiy when I could readily handle such things as the threading you mentioned as a requirement in my own code?

I know that if there were many lines of code required to create a timed self leveling pool that it would be adventageouse to use the container to do this. It is not the case that a large amount of code is required to do this so I have chosen to create my own.
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Commons DBCP and Commons DbUtils.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic