Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how many initial connections should be opend

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most containers provide a connection pool for you.
Which one are you using?
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. Tomcat provides connection pooling. Read the documentation.
 
Cm Ananth
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mate, you are pretty carefree with your passwords.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic