Qerying several times.

I need to have different product information from multiple tables for different categories in the server cache or I need to fetch from Database every time. What will be the better way.
Solution 1: I can query upfront from DB and can crate objects in the server(10MB data). Over heads are these created objects takes lot of JVM memory and another one is at initial load going to connect/disconnect(db connections) DB several hundred times. Advantage is whenever I need certain information I can look for the object and can process things fast.
Solution 2: I can run the queries on demand, whenever needed. If transactions grows, performance goes down drastically. Because of querying DB each and every time.
Another though solution is using entity beans; appreciates your input on this.

Hi,
If you are following Solution 1.
1) It the DB size is huge , you cannot cache in the
memory.Of course it depends on the size, but you can cache very large databases in memory.
Prevalyer is basically based on that exact idea... http://www.prevayler.org/wiki.jsp
If you search this forum you will find at least one mention of using 16 gig of memory with a cached data store.
If you are following Solution 2.
2) As you are doing only selects what ever be the
size of the DB, if the query is properly tuned and if
the table is indexed, then the query would execute in
no time. Always use prepareStatement , it is much
faster and if you are going for Vendor specific then
you can write StoredProcedures where you can execute
more than one query at a time and in no time.
Technically for single requests, prepared statements are always slower. The only time that isn't true is if the database doesn't support prepared statements at all. There are of course other reasons for using prepared statements.
You can search the forum for benchmarks that demonstrate this.
Most systems will end up using single queries, even when the query is repeated due to the overhead and complexity of keeping and maintaining prepared statements. Normally the case where this isn't true is when processing a batch (many similar rows at once.)
But the other benefits of using prepared statements will offset the performance difference for most situations.

Similar Messages

  • Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Remove the extensions, redownload Safari, reload the extensions.
    http://www.apple.com/safari/download/
    And if you really want a better experience, use Firefox, tons more choices and possibilities there.
    Firefox's "NoScript" will block the Trojan going around on websites. Best web security you can get.
    https://addons.mozilla.org/en-US/firefox/addon/noscript/
    Ghostery, Ad Block Plus and thousands of add-ons more have originated on Firefox.

  • How do I uninstall from iMac? I keep getting malware saying my pc (wrong!) has suspicious programs, etc., even though I have drug it to trash and reinstalled several times.

    Earlier today Firefox crashed. Later a window came up, with the rest of the screen grayed-out, saying there is suspicious programs on my 'pc' (wrong because I have an iMac) and it will run a scan to see if there are any suspicious programs. I immediately quit Firefox, with an additional window popping up asking if I really wanted to quit the page, that data may be lost. I quit. I tried restarting my computer, but in opening Firefox, it did the same thing. I then tried to delete FF by dragging it from my appl. folder to trash and reinstalling using Safari. Did this several times with the same result...still get the popup window saying the same thing each time.

    Earlier today Firefox crashed. Later a window came up, with the rest of the screen grayed-out, saying there is suspicious programs on my 'pc' (wrong because I have an iMac) and it will run a scan to see if there are any suspicious programs. I immediately quit Firefox, with an additional window popping up asking if I really wanted to quit the page, that data may be lost. I quit. I tried restarting my computer, but in opening Firefox, it did the same thing. I then tried to delete FF by dragging it from my appl. folder to trash and reinstalling using Safari. Did this several times with the same result...still get the popup window saying the same thing each time.

  • My earpeice on my Iphone4 does not work. It acts as if i still have earphones plugged in. I have tried plugging in and out the earphone several times but it still has not resolved the issue. I have rebooted my phone but the problem still exits. Suggestion

    Hi, I am using and Iphone 4 with OS 4.2.1, I recently started facing issues with my iphones earpeice. It acts as if the earphones are still connected. I have tried plugging in and out the earphones several times as per several posts confirming a fix for the issue, however i am still facing the problem. Please suggest..!!!!

    We had the same problem, but figure out the solution.
    You MUST have at least 1 song added to your ITUNE!  After you add a free song, then everything else should work as normal!
    Hope this helps!

  • 790FX-GD70 - have to boot several times - CMOS Memory Wrong - 2E?

    Well I just recently bought this mobo and have some problems already.
    My config ============
    - Phenom X4 955
    - 4GB GoodRam 1333MHz
    - Sapphire Radeon HD4890 Vapor-X
    - Intel SSD 80GB Gen2
    - Samsung H3EG 500GB
    - PSU BeQuiet! PurePower L7 530W
    All power cables are connected to motherboard and the GPU (even both extra 12V).
    ========================
    At first it worked fine, I installed Windows 7 without any problems, all of the programs etc.
    The only thing I changed in BIOS is the CPU Fan speed - because I have a very loud AMD box fan I just set the desired temp. (60C) and set the lowest fan speed for 25% - that's all.
    Then, on the next day I started the PC up and all I saw was a black screen - no graphic info on the monitor, all fans running and POST led showing 2E.
    I turned it off and the next boot went fine. The PC was running fine and stable the wholeeee day, no problems whatsoever.
    After two or three days the problem worsened - it now takes not one but several (probably around 10) reboots to make the PC running. At all times the POST-LED shows "2E". After it finally starts then I see the message CMOS Memory Wrong Hour and Date not set etc. After I set it up all works fine further on (I usually keep my PC running for 10 to 16 hours).
    However, there's one other thing - AFTER I turn the PC off it starts again by itself! And it's again with an error! Now, that's sick...
    My guess is that something is interfering with the CMOS mem or the chipset. A good indicator of that is the CPU fan - at normal boots I can hear its RPM going down just after the PC starts, way before it gets to initializing memory. With an error-start the fan works at full speed all the time.
    So, in short:
    1. I have to boot my PC several times before it starts correctly.
    2. I get the CMOS Memory Wrong message after a successful boot.
    3. When running the PC is stable, has no problems, shows no errors or signs of instability.
    4. When I turn it off (Windows -> Shut down) the computer starts again by itself - and with an error again (CPU fan is working on high RPM, screen is black etc.).
    Any idea? I unplugged all small cords (Power LED, Power Switch, HDD etc.) and start the PC with a button on mobo - but it made no difference.

    OK, it's not the PSU - I have just found what causes the problem.
    I followed the trace left by my monitor and apparently my computer will not boot without the monitor turned on before.
    I tried several times - every time my screen is off, the PC won't start. When it's on (before the PC itself) everything works fine.
    I guess I have to wait for my new screen and check it out again. As I said - I use an old CRT Dell with VGA -> DVI adapter - and I believe it is the cause.
    I noticed that even putting the adapter itself on the cable when the monitor is on, makes it react to it. Maybe there's some electric charge that goes through the card to the mobo? I don't know. Odd enough - this is the source of the problem - 95% sure
    Anybody has any idea why it happens?

  • My iPhone will not allow me to use slide screen? i have powered down and restarted several times. still cannot acces my phone. help needed.

    My iPhone will not allow me to use the slide feature. I have restarted the phone several times. any suggestions?

    Try rebooting.  Press and hold BOTH the power and home buttons at the SAME time until the Apple Logo appears, then let go of both buttons and your iPhone should restart.  See if you can use it when it comes back up.

  • I updated my iPhone 4S and my iPad 4 to iOS 7 now they both drop all my contents all my notes go missing I keep having to turn it off and on sometimes several times to make a phone call and the scroll rarely works is there anything I can do?

    I updated my iPhone 4S to iOS 7 now my phone constantly deletes all my contacts and takes days to download them from my iCloud again, constantly needs to be turned off and on sometimes several times to make a phone call, the scroll rarely works, is there anything I can do, the apple tech told me it was something I'd just have to get used to, my phone worked perfectly before the update.

    Even if it is a hardware problem they should fix it regardless of warranty. If you buy a car and after 1.5 years the doors fall off due to a failure in their design and construction, do you think the car manufacturer could pull off what Apple is trying to do? Yes the car still delivers its primary objective of driving from A to B, but significant functionality has been lost due to their fault.
    It is the same with this iPhone wifi problem. Apple are a disgrace, I have had significant Apple Hardware failures with my MacBook Pro and iPhone within 2 years of purchase. Pathetic quality.

  • HT204053 i will try several times to create my apple id then when i verify with my email id they say your apple id is not verified

    i will try several times to create apple id when i verify my account it display your account is not verified.

    iOS: Troubleshooting FaceTime and iMessage activation

  • I am trying to print a booklet.  I have printed it several times without issue.  Now when I print, it gives me one blank page or else 2 out of my 8 pages?

    I am trying to print a booklet.  I have printed it several times with no issues.  Now when I try to print it (with no changes in the program) it will either give me a blank page or will print one of my pages (there are 8 pages total). Any help?

    No I didn't even read through your post, to long.
    You said that "No matter what program I try to install, as soon as the installer opens it crashes". Were you talking about the install for this/these 3D programs or ANY program? As it is worded it sounded like ANY program. That tells me there is a problem with your Mac, software or hardware.
    Now you say others install programs, which is it. Programs other then the 3D ones install or no programs install?
    Could simply be your Mac is to old to run these programs and the installer knows that. You never said what model or year Mac it is.

  • I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted!

    I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted and I can't use my computer!!

    I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
    Hope this helps.

  • I am trying to get into my Game Center app but every time I tap on the app it opens too a blank white screen. I have tried several times to reset my phone but I get the same result.

    I am trying to get into my Game Center app but every time I tap on the app it opens too a blank white screen. I have tried several times to reset my phone but I get the same result.

    Hello there Sweebs44,
    It sounds like you are tapping the Game Center app to open it, but the screen is blank. I recommend signing out of your account:
    Go to Settings > Game Center, where you can:
    Sign out (tap your Apple ID)
    From: iPhone User Guide
              http://help.apple.com/iphone/7/#/iph6c493cac
    Then close all the running apps:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    When you have done that restart the phone sign back into your account and try again:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • HT3887 my bluetooth says 'Not Available' how do i get it to work again. I have restarted the computer several times and have replaced the batteries in both the keyboard and mouse and yet it still is not working! please help

    my bluetooth says 'Not Available' how do i get it to work again. I have restarted the computer several times and have replaced the batteries in both the keyboard and mouse and yet it still is not working! please help

    I have had the same problem. It was cured by turning computer off and/or restarting it. I am not sure  if once was enough. I think shutting down must cut out whatever it is that blocks bluetooth. Good luck

  • Itunes wont open on my Dell laptop. I have uninstalled and re-downloaded several times. i would welcome any assistance on this matter. thank you.

    iTunes will not open on my dell laptop any more. I have uninstalled and downloaded several times but no joy. I would welcome assistance with this problem please. Thank you

    Hi jophis25,
    Thanks for visiting Apple Support Communities.
    If iTunes wont launch on your PC, the steps in this article can help:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/ts1717
    All the best,
    Jeremy

  • I get an error 7 (Windows error 126) when I try to open itunes. It says that it wasn't installed correctly. I have removed and reinstalled this program and all accompanied programs several times. My itunes was fine until I did an update several months ago

    Please help. I have been using itunes with my ipod nano for years. Several months ago I did a requested upgrade and have not been able to open itunes since. I get an error message that says that itunes was not installed correctly. Error 7 (Windows error 126) I have tried to uninstall all Apple programs and reinstall itunes several times and it doesn't work. I keep getting the same message. I am looking for a solution to get my library back so I can but more songs for my ipod.

    I have same problem--did you ever find a solution?

  • I'm trying to open itunes and keep getting an error message that i'm missing a file, MSVCR80.dll.  How do I fix this?  I've tried uninstalling and re-installing itunes several times.

    I am trying to open itunes on  my computer.  Windows 7 64-bit operating system.  When I try to open itunes, I get an error message saying MSVCR80.dll file is missing.  Where can I find this file and how can I get it on my computer?  I have tried uninstalling and reinstalling itunes several times.  Thanks for any help.

    See this User Tip by turingtest2
      https://discussions.apple.com/docs/DOC-6562

Maybe you are looking for