Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3340994
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:40:18+00:00 2026-05-18T00:40:18+00:00

I have a doubt. I need to get the data from the sever twice

  • 0

I have a doubt. I need to get the data from the sever twice every time when I load a page, one to render the HTML and another one to get the data for client side (javascript).

So I don’t know exactly what it’s the best way and fastest. I was trying to implement a session object and store the data once using joinedload loading technique. When the data is in the client side, to kill the session object.

Another one it’s to call the database twice.

I don’t know which one is faster and better because I don’t know if the database or server stores the first call in memory. If so it’s not like to call the database twice, right?

And if the second choice is better which loading technique (joinedload, eagerload or subqueryload) is better to use.

Every call could be a bunch of data.

Any help could be really useful.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:40:19+00:00Added an answer on May 18, 2026 at 12:40 am

    I’m not really sure about all this stuff you asked, so I’ll try 2 different scenarios.

    • If the data you need to display the html and data needed for the javascript is the same – you’re doing it very wrong. All you need to do is to query the db only for the html, then structure the data needed for javascript in hidden fields, then, on client side, query the html’s hidden fields with javascript and use the data onward.
    • If the data sets are different than you’ll probably need an ajax request from the client side after the html is displayed. That is, an additional http request. I say you close the db connection after the first call, and then reopen again with the next http request. Every http request is on its own, you’ll need to take care with opening/closing connections inside a single request. [That is, if you don’t use pooling, but that is another issue]
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JTable which is loaded from a data-structure using table model.The data-structure
I have a doubt: - Is there any standard/convention that when should I use
I have a C++ memory management doubt, that's (obviously) related to references and pointers.
LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL
I have some doubt, about FB Log in system integration in my website ,
I have a doubt regarding xml structured content in OpenCms. I have two XML
I have a doubt regarding .net messaging & its compatibility with other open protocols
This is not an urgent need but more of a curiosity I have had
I need to capture an image from a webcam (tethered camera, etc.) into a
I have a script that appends some rows to a table. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.