Reducing Database Call Techniques...query caching the only way?

What's the most efficient way to reuse data that gets called on practically every page of an application?
For instance, I have a module that handles all my gateways, sub pages and subgateways etc etc.  This will only change whenever a change is made to the page structure in the admin portion of the application.  It's really not necessary to hit the database everytime a page loads.  Is this a good instance to use query caching?  What are the pros, cons and alternatives?  I thought an alternative might be to store in a session, but that doesn't sound too ideal.
Thanks!
Paul

What's the most efficient way to reuse data that gets called on practically every page of an application?
That sounds like a question from the certification exam. The answer is to store the data in session or applicaton scope, depending on the circumstances. If the data depends on the user, then the answer is session. If the data persists from user to user, then it is application.
admin portion of the application.
Suggests users must log in. Otherwise you cannot distinguish admin from non-admin.
This will only change whenever a change is made to the page structure in the admin portion of the application.
Then I would go for storing the data in application scope, as the admin determines the value for everybody else. However, the session acope also has something to do with it. Since the changes are only going to occur in the admin portion, I would base everything on a variable, session.role.
You cache the query by storing it directly in application scope within onApplicationStart in Application.cfc, like this:
<cfquery name="application.myQueryName">
</cfquery>
The best place for the following code is within onSessionStart in Application.cfc.
<!--- It is assumed here that login has already occurred. Your code checks whether
session.role is Admin. If so, make the changes. --->
<cfif session.role is 'admin'>
<!--- Make changes to the data in application.myQueryName, otherwise do nothing --->
</cfif>
Added edit: On second thought, the best place for setting the application variable is in onApplicationStart.

Similar Messages

  • Is the only way to stop the iphone vibrating while on a call to set it to silent?

    Is the only way to stop the iphone vibrating into your ear while on a call to set it to silent?
    Many thanks.

    Yes.

  • Phone works great but when on a call proximity sensor kicks in turns off the screen. When I pull the phone away from my head screen is still blank. The force hangup/lock is the only way to bring the screen back on

    hi,
    phone works great but when on a call proximity sensor kicks in turns off the screen. When I pull the phone away from my head screen is still blank. The force hangup/lock is the only way to bring the screen back on.
    I purchaged it before one month onl. So i wont understand how it comes. Please help me. I am waiting for you reply.

    "Your face is so ugly, it broke your phone!" Ha ha. Get it? How I was joking there? About your iPhone not working correctly after... <sigh>
    But seriously, you said the situation only happens when you have been on a long call, so maybe the iPhone is just autolockng?

  • When I'm in a call, I can hear beeping like I'm getting another call but the name doesn't show up and the only way I can see who called is if they leave a voicemail

    I have an employee who has an issue when on calls. When he is in a call with someone, he can hear another call beeping in but no name shows up. The only way he can see who called is if they leave a voicemail. He says the phone is up to date with software. Wondering if anyone can help me figure out what is going on.

    Morning katesnazzy,
    Thanks for using Apple Support Communities.
    There are different methods for enabling and using the following features, depending on your wireless carrier's network technology
    For more information on this, take a look at this article:
    iPhone: Understanding phone features
    http://support.apple.com/kb/HT4515
    Best of luck,
    Mario

  • When we miss a call, the "Slide to Unlock" doesn't respond to touch. The only way out is to have someone call your iphone and then "Slide to Answer" will respond and once u end the call it will start responding to "Slide to Unlock" this started happening

    When we miss a call, the "Slide to Unlock" doesn't respond to touch. The only way out is to have someone call your iphone and then "Slide to Answer" will respond and once u end the call it will start responding to "Slide to Unlock" this started happening after upgrading to IOS 7.
    iphone 4S IOS 7.0.3.

    In your first post you mention you have done a reset and a restore. Those are the last two processes in the user troubleshooting. If those do not work, then the last thing is to go to the Genius Bar. You say you went to Apple and they opened the phone and re-seated the connectors? That sounds unusual, because if there was a hardware issue,they would replace the hardware. You say you cannot get a replacement, is that because you are out of warranty? An out of warranty replacement is only $199 plus tax. It seems to me since you mention the fact you need to press hard to get the screen to react there is something going on with the hardware. If this problem has been going on for over a year, have you been reporting this to Apple. You say you cannot get a replacement and you are on the second phone, I wonder why they are denying you a replacement. Is there something you are not telling us??

  • I'm getting a similar message: There was an error opening the database..." and the only option I get is a "quit" button. Help!

    I'm getting a similar message: First it offers me chance to repair - but if I it repair, it crashes.  Then if I select do not repair I get the following warning: There was an error opening the database..." and the only option I get is a "quit" button. Help!

    From the path in the error message you posted it appears that the library is not on your internal (root) drive.
    What type of disk is the library on and how is it formatted?
    The crash log Léonie is referring to is what is printed out when Aperture crashes. You wrote that Aperture crashes in your first post so if the app crashes you must have gotten a crash report.
    Message was edited by: Frank Caggiano

  • TS2755 i need to know how to block someone from sending me txt/imessges and calling me. they have a iphone too so i have been told the only way to block them is to turn off my imessages and only recieve regular txt messages. is there another way to block

    how do u block someone from sending imessages and txt and calling ur phone when they have a iphone also. I have been told the only way is to turn off my imessages and recieve regular text messages.. is there another way?? i have searched for apps and cant find one. neeed help!!!

    There are no apps and that is not a feature of iOS.
    iMessages are handled by Apple's own system, and there is no way to block a specific sender.
    SMS messages and voice calls are handled by your cell service provider, so you need to ask them what blocking (if any) features they offer.  If the texts are just spam, you should be able to report them to your carrier and they can block that sender.  Other blocking options will vary from carrier to carrier, so call yours and ask them what they can do.

  • My volume buttons won't work. Music plays when I get a phone call. That is the only time my speaker makes noise. My settings are how they should be, the top button is not on silent, I've shut my phone off many times, I've totally restored my phone. Help

    My volume buttons won't work. Music plays when I get a phone call. That is the only time my speaker makes noise. My settings are how they should be, the top button is not on silent, I've shut my phone off many times, I've totally restored my phone. Help

    Genius reservation http://www.apple.com/retail/geniusbar/

  • The only way i can make or receive calls now with my iphone 5 is by using speaker.  what can i do to remedy this annoying issue.

    the only way i can make or receive calls now with my iphone 5 is by using speaker.  what can i do to remedy this annoying issue.

    If you have the computer that you first setup the phone with iTunes then just connect the phone to that computer via. the USB cable and see if a sync can be done.

  • TS1630 The only way I can place or receive calls is through the speakerphone or bluetooth.hone or

    The only way I can receive or make calls is through speakerphone or bluetooth,

    i have a 3gs i got a couple years back, and the major problem is that the phone doesnt play sound, unless you are on a call(speakerphone).i had upgraded the os, changed the speakers,headphone jacks and still the problem is there.

  • When using office for mac or i studio after inserting several pictures, my computer locks up and the only way I can fix it is to do a force quit.  Why does it do this and how I I get it fixed without a force quit?

    I have a mac book, with office for mac and iStudio installed.  When I try to create a document using either one of these; after inserting several photos, the computer locks up and the only way I can get it to unlock is to do a force quit.  Why does it do this, and how can I get it to unlock without having to do a force quit?

    Are you using versions of the software that are compatible with the version of OS X you have installed? Very often such lockups are caused by application incompatibility.
    The problem may also come from trying to use both sets of applications at the same time while not having enough RAM installed. Adding more RAM may fix the problem.
    The problem can arise from corrupted support files such as preference files or Application Support files or corrupted cache files.
    The image files you are using may also be corrupt thus causing the problem.
    You might start with:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility.  For situations DU cannot handle the best third-party utilities are: Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation.  TechTool Pro 4.5.1 or higher are Intel Mac compatible;  Drive Genius is similar to TechTool Pro in terms of the various repair services provided.  Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.  These utilities have limited or no functionality with Snow Leopard or Lion and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old log files and archives, clearing caches, etc.  Other utilities are also available such as Onyx, Lion Cache Cleaner, CockTail, for example.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. There is no confirmation that this version also works with Lion.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.

  • I forgot my Apple ID security question answers and cannot contact iTunes support by phone. The only way I can ask for help is via email. How can I make that happen?             Thanks

    Hi! So I haven't used iTunes in a few months but I just got an iTunes gift card and want to make a purchase. iTunes redeemed it just fine but now that I want to make a purchase I am having problems. I can't remember my security question answers and iTunes is requesting them. I have two other verified emails but the are NOT rescue emails. I can't contact iTunes over the phone because my phone lines are out and are going to be out for a long time. The only way I can contact them is by email. How can I do this? Is there an easy way to just reset all my security questions? Please help a girl out. I just want my music!
    Thanks so much

    Alternatives to Reset Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Start here to find your country, and how you can contact Apple:
             Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Support in your country and ask to speak to Account Security.
              Customer Service: Contacting Apple for support.
    How to Manage your Apple ID: Manage My Apple ID

  • Working with my 2 FireWire HD i had a crash. the only way to start was a safe start. then id maged to start from a DVD and install a MAC OS 10.3 wich ran 4 some time then the same problem only safeMode. kernel panic inserted the tech tool DVD

    working with my 2 FireWire HD i had a crash. the only way to start was a safe start. then id maged to start from a DVD and install a MAC OS 10.3 wich ran 4 some time then the same problem only safeMode. kernel panic by inserting the tech tool DVD, wich produces the following highligted text:
    panic(cpu 0 caller =xffff0003): 0x300 - Data access
    latest stack backtrace for CPU 0:
    Backtrace:
    0x0009CC88 0x00D63C 0x00029DAO  0x000BOA10 0x000B4270
    proceeding back via exception chain:
    Exception state (sv=0x26acd700)
    PC=0x2717E900; MSR=0x00009030; DAR=0x00000000; DSISR=0x40000000; LR=0x2717EBE4; R1=0x26AD3AE0; XCP=0x0000000C (0x300 - Data access)
    Backtrace:
    0x27178B0 0x00344ACB 0x00345970 0x2717EC08 0x2718458 0x00340590
    0x003496EC 0x0034B59C 0x0034A6BC 0x000B1DD4
    Kernel Loadable modules in backtrace (with dependencies):
    com.apple.driver.AppleFWDHC1(3.9.5)00x2717c000->0x271aafff
    dependency: com.apple.iokit.10PCIFamily(2.6)00x1e840000
    dependency: com.apple.iokit.I0FireWireFamily(3.4.7)00x270dd000
    Exception state (sv=0x26abd280)
    PC=0x00000000; MSR=0x0000D030; DAR=0x00000000; DSISR=0x00000000; LR=0x00000000;R1=0x00000000; XCP=0x00000000 (unknown)
    BSD process name corresponding to current thread: kernel_task
    so what
    greetings from berlin

    Greetings,
    It appears to be a FW problem, possibly flaky case, or drive problem.
    One way to test is to Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, Test for problem in Safe Mode...
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive
    Reboot, test again.
    If it only does it in Regular Boot, then it could be some hardware problem like Video card, (Quartz is turned off in Safe Mode), or Airport, or some USB or Firewire device, or 3rd party add-on, Check System Preferences>Accounts (Users & Groups in later OSX versions)>Login Items window to see if it or something relevant is listed.
    Check the System Preferences>Other Row, for 3rd party Pref Panes.
    Also look in these if they exist, some are invisible...
    /private/var/run/StartupItems
    /Library/StartupItems
    /System/Library/StartupItems
    /System/Library/LaunchDaemons
    /Library/LaunchDaemons

  • When trying to sign out of Hotmail the "back navigation button" remains green and I have to click sign out again and the same thing happens over and over and the only way to close Hotmail is to go to File and Close Frame, so what's my problem?

    When I attempt to sign out of Hot Mail by clicking "Sign Out," I get the "Sign In" instruction as I always have, however, the green Firefox navigation button remains on bright green (not going to gray) and my MSN home page will not close automatically as usual. I click on the green arrow and I get an instruction to "Sign Out" again. I click on that and get the "Sign In" again but the arrow stays green. I can repeat this countless times and never get signed out and always remaining on the MSN home page. The only way I can close is to go to File and click on Close Window and then my homepage will close and go back to desktop. I've been using Firefox for a couple of years now (IE prior to that for ten years) and have never had this problem. After using "Close Window" I go back onto my home page, from the desktop, and the navigation button is grayed out normally until I sign in again and we start the cycle over again. Have I been hacked?
    == This happened ==
    Every time Firefox opened
    == Approximately a month ago.

    I was doing a side-by-side comparison of the new and old server (we backed up the server before the reformat) and I can see that, evidently, CR XI was installed.  We have the directory C:\Program Files\Common Files\Business Objects\3.0 and all the versions match what is located in the project's bin directory.  Does this confirm that I did have XI installed and licensed at one time?
    If I purchase a more recent version, couldn't I update the reports to use the newer version?  I have all the source code.
    Thanks for your help, it is a nice sanity check for me after hours of reading forums and documentation.
    Also, just a shot in the dark, but I'm assuming it wouldn't do me any good to simply restore the aforementioned folder to my C drive?  Would that work if I registered all the dll's?
    Edited by: Eric Hollering on Dec 2, 2009 6:40 PM
    To be clear, I do have VS 2003 & 2005, and I have the source code.  I just have never used Crystal Reports in any of my .NET apps because the need wasn't there, so recompiling is not out of the question.
    Edited by: Eric Hollering on Dec 2, 2009 6:49 PM
    Also, I looked at the CrystalDecisions.CrystalReports.Engine.dll that was in the C:\Program Files\Common Files\Business Objects\3.0\Managed folder and when I right-click and view the properties, then the Version tab, in addition to the 11.0.9500.2 version number, there is a property called Product Version that has the value .NET.  Does that mean that this dll was bundled with Visual Studio?
    I also found this directory on the old server...does this tell you anything?
    C:\Program Files\Business Objects\BusinessObjects Enterprise 11
    I did see that you can still buy XI from CDW.  I have a call into them currently to check with Business Objects for any registrations from my company.
    Edited by: Eric Hollering on Dec 2, 2009 8:27 PM

  • Firefox gets to a point that it tries but will not load any page including my home page!!!! The only way around the problem is by reinstalling it.

    When I try to start Firefox, I get nothing!!!!!! The only way I can fix this problem and get access to the WEBB and my starting home page is to reinstall it all over again. This has happen enough times that I am about not to use it again unless you have a fix for this problem!!!!!! For now I have loaded version 20 and am off and running again until it happens again.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!

Maybe you are looking for

  • Saving scheduled report in a Sharepoint document library

    I am trying to schedule a crystal report through Infoview and I want the resulting report saved in a Sharepoint document library. Is this possible? I am using BOE 11.5

  • Array Of Primitive Type (kodo3.4)

    Hello, I want to map an array of primitive type (double[] or double[][] or...) to a blob, so I specified the mapping this way: <extension vendor-name="kodo" key="jdbc-field-map-name" value="blob"> <extension vendor-name="kodo" key="column" value="DAT

  • Varchar Column Returning Null Value

    Hi I have a report with a subquery which contains a dynamic from clause which is set by the main query, the report returns date and number values from the view in the subquery but does not return varchar2 values, if I select the varchar2 values from

  • Chart calling from java

    hello, is there anyone know how to call a chart from a jsp, and passing parameters to it ? thanks in advance

  • Ethernet connection failure

    Hello: New MAC user, PowerMac G4, connected to cable modem. Internet doesn't connect. Cable co. says internet connection is great, trouble is with computer. Went through troubleshooting articles re: setting preferences, but perhaps didnt' go deep eno