This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes how many initial connections should be opend Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how many initial connections should be opend" Watch "how many initial connections should be opend" New topic
Author

how many initial connections should be opend

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
i am developing an application for intranet.

so in the intranet there will be 30-40 ppl will login to this application

so i need to use connection pooling

i am using this ready made class file for connection pooling
so the problem is how many initial connections should be opend?


thanks in advance



i am using this class file



is this code enough for creating connectionpooling ?
or should i go for other ?


please help me out


thanks


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Most containers provide a connection pool for you.
Which one are you using?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Originally posted by Ben Souther:
Most containers provide a connection pool for you.
Which one are you using?


i am using tomcat 4.0
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yup. Tomcat provides connection pooling. Read the documentation.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Cm Ananth
Ranch Hand

Joined: Oct 20, 2005
Posts: 44
One suggestion, if you have planned to use this Connection pool code in your production environment, please have a look at the whole getConnection() method is synchonized.. i think this will hit the performance considerably.. please use synchronized blocks inside the method, wherever required..


By Ananth, Bangalore
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
mate, you are pretty carefree with your passwords.
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Originally posted by CM Ananth:
One suggestion, if you have planned to use this Connection pool code in your production environment, please have a look at the whole getConnection() method is synchonized.. i think this will hit the performance considerably.. please use synchronized blocks inside the method, wherever required..


so i should alwasy prefer synchronized blocks over synchronized methods in all the cases??? thanks!!!
 
wood burning stoves
 
subject: how many initial connections should be opend
 
Similar Threads
problem in connectionpooling
problem in connectionpooling
Problems with connection pooling.
Connection pooling with my own cofiguration file instead of Initial Context.
connection pool problem