• 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

Synchronization

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I had posted a very simmilar topic in the JDBC section, I got some answers but I still am a bit confused, so here is the detailed discription of my problem:
I am designing a web applicatin where I have a few Jsp pages, some Java Bean files which are instansiated by the Jsp pages and one Java Bean file(DataBean) which takes care of the connections to the database.
For Example: I have an application which searches the database for some items depending on the search criteria entered by the user. To accomplish this I have a jsp page which takes in the user input for the search criteria, and one of the Java Bean methods is invoked by the jsp page and the user input is passed as the parameter of the method. Inside the Java Bean method the Sql statement is prepared and is sent to the DataBean where a connection is established and the sql statement is executed and the resultset is returned back to the Java Bean file.and this resultset is returned back to the Jsp page for displaying it.
Now this works fine when a single user accesses the page, but I am not sure if it work fine if mutiple users access it at the same time. If it does not work then how to I get around the problem? So please if somebody can share there ideas it would be great.
Thanks a lot.
Bye
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since connections are expensive operations, you should get a connection only once, when your application is loaded for example and keep using that connection to the database. If necessary, you could also get a connection from a pool and return it to the pool when you are done using it.
 
Anup Mahale
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I am using connection pooling.is that all I need to do?
 
reply
    Bookmark Topic Watch Topic
  • New Topic