• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

website dao design

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Just consider amazon.com landing page just after user logging in to amazon.com. it contains list of products and left menu and header information.
I am planning to design some thing like this for my project. My question is , data that is getting displayed on the website is fetched from different tables in the database.
HOW is DAO method is designed?  
1. If a group of database object is fetched from database tables, then for multiple groups that needs to be displayed on website, multiple database connection will be created? For single user?
2. Or using only single database connection, full screen data is pulled from database and display on the user screen.

Regards,
Sudhir
 
Rancher
Posts: 4603
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would use a connection pool and get a connection as and when you need one, though retaining one for a transaction.

If you look at Amazon, there are multiple calls to the web server, for each section you see on the screen.
So that would be multiple requests to the database.
 
sudhir ka
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave!
I am currently using connection pool for database access, but don’t you think for each web page to get displayed , we want to make multiple connection and if 10 of thousand user access amazon.com at a time then so much connection needs to be used?

Any thought on this issue?

Thanks,
Sudhir
 
Dave Tolls
Rancher
Posts: 4603
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole point with the pool is that each connection is only used briefly, so there is less chance of contention.

There may be 10000 requests, but each one only needs a connection for a part of its processing.
 
Just the other day, I was thinking ... about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic