How to generate Unique Cache keys?

I am trying to improve the performance of my ColdFusion 10 application by better use of caching.  I have a CFC of DAO/Gateway special interviewing a particular database.  I added the query caching the query in this CFC and it made a huge difference.

As this database is out of my control changes/updates, I need to be able to open the purge of the request (s) for this database only.  I don't think the built-in queries to ehcache ColdFusion cache allows granular control of hot flashes - in Administrator of CF that you can pretty well rinse only all of the cache.

So I thought that the only solution was to create my own region of cache that is associated with this database and manually cache the queries in this region.  Then I can rinse just this region without impact on other queries cached.

So here's my problem: I think internally, ColdFusion implements the query cache using a hash of the generated SQL code.  I think I'm going to store my queries in the cache with a key that hashes the input parameters.  The Hash() built-in function would be an appropriate mechanism to create cache keys that are unique for each combination of parameters?  Does it matter what algorithm to use with Hash()?

Thank you

-Carl V.

I guess I'll answer my own question.  I tested using Hash() using the MD5 algorithm, and it seems that it generates repeatable unique values for each combination of parameters.  I did this:

  1. Create a Struct containing pairs key / value parameters (name of the parameter, the parameter value).
  2. Convert the structure to a string using SerializeJSON().
  3. Chop the string using the Hash() with MD5.

This seems to be what I was hoping.  I would still get a confirmation that it is a good approach, or if there are better ways to do it.

-Carl V.

Tags: ColdFusion

Similar Questions

  • How to generate the primary key element and move to another page?

    How to make the primary key value to another page in a table?

    Form on T_ITEMS 2.png

    Hello

    I am a beginner in the apex,

    Please, now I want to add the primary key to page 1 for item id in page 2...

    Notice:

    Before, I created (process of pl/sql in the rendering of page @ after the header section) to get the id of secuance.

    BEGIN
    :P17_ID := seq_t_items_id.NEXTVAL;
    END;
    
    
    

    primary key is generated for the element ID of page 1... BUT When I update 'page 1' I see error and solved when shut down my browser and open it again...

    Please help me to...

    1. Generate a primary key (article id @ page 1)... without refresh error. ?
    2. Pass him (item_id) on page 2

    Thank you all for...

    Sorry I'm beginner in apex,

    I don't know how Pass value of the item_id TO page 1 page 2 "in the form ID", turn to the first PHOTO... .
    Help me..

    Thank you

  • How to generate a primary key atumatically in jdeveloper 10 g

    Hello

    I use jdev 10g. I created a web applicaton of fusion.
    I get no option to automatically generate the primary key in the sequence.
    In Jdev11g, we can create by trigger easily.

    Help, please
    Thank you
    REDA

    Hi reda,.

    Visit this link

    [http://download.oracle.com/docs/html/B25947_01/bcentities006.htm#sm0147 | http://download.oracle.com/docs/html/B25947_01/bcentities006.htm#sm0147]

    Kind regards
    Vikram

  • data transfer from one table to another and by generating a primary key

    Hello experts,

    Well, I have 2 paintings and I need to move columns in one of them.
    the problem is state that the primary key of the second table has to go in a column in the first table, and I generate a primary key in the first table as well. How to generate the primary key

    You can insert the value of key primary agent_id from agent table via before level trigger for insertion line. The agent_id value can be generated through a sequence.

    the trigger code can be as

    create sequence seq_agent;
    
    create or replace trigger trg_agent_id before insert
    on agent
    for each row
    declare
       v_agent_id number;
    Begin
       select seq_agent.nextval into v_agent_id from dual;
       :new.agent_id:= v_agent_id;
    End;
    

    So when will pull you insert tasks than this agent_id value will be added. And you will not get error

    Twinkle

  • Automatically generate unique key

    I am currently working on a registration form. A user must enter their address electronic and other data. At the same time, when the form loads, I want a unique key must be generated. A key that looks like example as follows: afg1csd6df4. Or regardless of numbers with letters. This key would be added as the value of a hidden field to a form. This is possible using PHP?

    Try this, see if it helps.

    http://cookbooks.Adobe.com/post_Registration_system_that_requires_the_user_to_vali-16646.h tml

    Gary

  • Generate Unique hash in PL/SQL key

    I have a document I want to send to some customers. What I decided to do is to send the customer a link to the document that is stored locally on our server. Obviously for safety reasons, I simply send the sequential doc ID allowing customers to modify the query string for more information.

    What would be the best way in pl/sql to generate a unique hash key to include in the url? The key should be unique and not easily edited by visitors to see other documents.

    Any help would be appreciated.

    Faoilean.

    You can use the DBMS_CRYPTO package to generate a hash value based on the file name of the document. If the file name is unique OS will be the hash value, and you can store pairs of hash/file name in a search to get the correct file.

  • How to check the Windows key is original and unique user only

    Hello

    If I will buy another retailer windows operating system. so, how to check the windows key is original or not?

    How to check the windows key is single user or three key user? How to learn about the windows key?

    Hello

    Find the key data is any tool?

    In my State, one of the retailer sold out of the window in two different users. the key is the same. But I did not how many users should be used the key to this series?

    That's why i, m here asking you friends

    Then you have been sold an illegal license key, as a license key is never sold on its own, more a license key is never awarded to two different clients.

  • How to generate the key Triple a.

    Hello

    I need key THE genearate Triple starting from a string. I used the following code. but he DESkey can anyone know the code class or the sample to generate THE Triple key?

    public createTripleDESKey (String strSignatureKey) {DESKey
    String originalKey = decodeBase64 (strSignatureKey);
    DESKey deskey = new DESKey (originalKey.getBytes (), 0);
    return deskey;
    }

    Hey I found 'TripleDESKey' of class in

    net.rim.device.api.crypto.TripleDESKey
    
  • How to create a foreign key constraint on a table nested column

    Dear Experts,
    I create 2 tables using the object type. the VESSEL_PARAM table contains the list of the parameters allowed.
    The table VESSEL_TYPE containe single item we list some parameters.

    On this table, I love the column VESSEL_PARAM table VESSEL_PARAM to check if the settings are and the reference value is allowed.
    How to create a foreign key?
    Here my script that generates this runtime error: 00904. 00000 - '% s: invalid identifier' on this line

    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (NAME, DATA_VALUE)
    REFERENCES VESSEL_PARAM (PARAM_NAME, LIST_PARAM_VALUE. DATA_VALUE)
    CREATE OR REPLACE TYPE OBJ_PARAM_VALUE AS OBJECT 
    ( 
      DATA_VALUE  VARCHAR2(20)
     ,DESCRIPTION VARCHAR2(125)
    ) NOT FINAL;
    /
    
    CREATE OR REPLACE TYPE LIST_PARAM_VALUE AS TABLE OF OBJ_PARAM_VALUE;
    /
    
    -- derive object subtype from object supertype
    CREATE OR REPLACE TYPE OBJ_PARAM_NAME UNDER OBJ_PARAM_VALUE (
      NAME VARCHAR2(30)
    )NOT FINAL;
    /
    
    CREATE OR REPLACE TYPE LIST_PARAM_NAME AS TABLE OF OBJ_PARAM_NAME;
    /
    
    Prompt create table VESSEL_PARAM;
    CREATE TABLE VESSEL_PARAM (
       PARAM_NAME   VARCHAR2(20) NOT NULL
      ,PARAM_DESC   VARCHAR2(125)
      ,PARAM_VALUE  LIST_PARAM_VALUE
      ,CONSTRAINT PK_VESSEL_PARAM PRIMARY KEY (PARAM_NAME)
    ) 
    NESTED TABLE PARAM_VALUE STORE AS PARAM_VALUE_TAB
    TABLESPACE CMS_ADMDATA;
    /
    ALTER TABLE PARAM_VALUE_TAB ADD CONSTRAINT UN_PARAM_VALUE_TAB UNIQUE (DATA_VALUE);
    /
    SHOW ERROR;
    
    Prompt create table CMS_ADM.VESSEL_TYPE;
    CREATE TABLE CMS_ADM.VESSEL_TYPE (
      VESSEL_TYPE  VARCHAR2(20) NOT NULL
     ,VESSEL_DESC  VARCHAR2(125)
     ,VESSEL_PARAM LIST_PARAM_NAME
     ,CONSTRAINT PK_VESSEL_TYPE PRIMARY KEY (VESSEL_TYPE)
    -- ,CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (VESSEL_PARAM) 
    --        REFERENCES VESSEL_PARAM (PARAM_NAME)
    ) 
    NESTED TABLE VESSEL_PARAM STORE AS VESSEL_PARAM_TAB
    TABLESPACE CMS_ADMDATA;
    /
    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT UN_VESSEL_PARAM_TAB UNIQUE (NAME);
    ALTER TABLE VESSEL_PARAM_TAB ADD CONSTRAINT FK_VESSEL_TYPE FOREIGN KEY (NAME,DATA_VALUE) 
            REFERENCES VESSEL_PARAM (PARAM_NAME,LIST_PARAM_VALUE.DATA_VALUE)
    /
    SHOW ERROR;
    Thank you

    Salvatore

    Could you please indicate your answer as correct if you judge them correct.

    Best regards

    Mohamed Houri

  • Access to a specific registry key (HKEY_USERS\S-1-5-18\software\Microsoft) causes a BSOD. How can I fix the key?

    Original title: access to a specific registry key generates BSOD. How can I fix the key?

    Scans the registry in XP causes a BSOD. The wrong key is HKEY_USERS\S-1-5-18\software\Microsoft. Access to manually also causes a BSOD so I can't delete or export it. I do not have a restore point from before the problem started. Other than the access to that key or run a search, XP works well.
    Is it possible to fix this?

    Not having no not this error in my notes (in other words, I've not seen at least 2 times), I Googled it and first fell on a MS KB article:

    http://support.Microsoft.com/kb/810558

    This article includes this statement:

    Contact Microsoft Technical Support to help heal the corruption in the registry.

    I think that is where you are right now, so let's see what is the response of the Microsoft Support Engineer, now that there is more information.  I always love to see what they have to offer first.

    Why and how did you change the system restore to create restore Points 3 a day for 30 days (FYI - that is not the same as a backup).

    If you were to solve some problem at the time, what was the question?

    The question was preceded by a loss of power, aborted reboot or abnormal termination?  (this includes the plug pulling, buttons power, remove the battery, etc.)

    In the meantime, I would run a chkdsk /r on your volume XP since XP Recovery Console.

    If you are not sure of the SP2 CD you have is an XP bootable installation CD authentic and not some kind of restore CD for the Dell system to 100%, I would recommend this (that I've seen more than 2 times):

    If you have no XP bootable media (or aren't sure you have) create a bootable XP Recovery CD of Console and don't forget (no support for XP not necessary).

    This is not the same as recovery disks that might have come with the acquisition of the system store.

    You can make a bootable Recovery Console CD by downloading an ISO file and burn it to a CD.

    The ISO bootable image file you need to download is called:

    xp_rec_con. ISO

    Download the ISO from here:

    http://www.mediafire.com/?ueyyzfymmig

    Use a new CD and this simple and free program to burn your ISO file and create your bootable CD (do not install UniBlue or the Ask Toolbar - never!):

    http://www.ImgBurn.com/

    Here are some instructions for ImgBurn:

    http://Forum.ImgBurn.com/index.php?showtopic=61

    It would be a good idea to test your bootable CD on a computer running.

    You may need to adjust the computer BIOS settings to use the CD-ROM drive as the first device to boot instead of the hard drive.  These adjustments are made before Windows tries to load.  If you miss it, you will need to restart the system again.

    When you start on the CD, follow the instructions:

    Press any key to boot from CD...

    Installing Windows... going to pronounce.

    Press 'R' to enter the Recovery Console.

    Select the installation that you want to access (usually 1: C:\WINDOWS)

    You may be asked to enter the password (usually empty).

    You should be in the folder C:\WINDOWS.  It's the same as the

    C:\Windows folder that you see in Solution Explorer.

    The Recovery Console allows base as file commands: copy, rename, replace, delete, chkdsk, fixboot, fixmbr, cd, etc.

    For a list of the commands in the Recovery Console, type help at the prompt of commands or read on here XP Recovery Console:

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/recovery_console_cmds.mspx?mfr=true

    A good idea before you start things must first verify the integrity of your file system by using the chkdsk command.

    In the command prompt window, run the chkdsk command on the drive where Windows is installed to try to fix any problems on the afflicted player.

    Running chkdsk is fine, even if he finds no problem.  It won't hurt anything to run it.

    Assuming your boot drive is C, run the following command:

    CHKDSK C: /r

    Let chkdsk finish to correct the problems, he could find.

    It may take a long time for chkdsk complete or they seem to be "stuck".  Be patient.  If the HARD drive led blinks always, chkdsk is something.  Keep an eye on the amount of the percentage to be sure that it is still making progress.  It may even seem to go back sometime.

    You must run chkdsk/r again until it finds no error to correct.

    Remove the CD, and then type "exit" to exit the RC and restart the computer.

    You have not to set the BIOS to boot the disk HARD since the CD won't be.

  • How to generate sequences without gaps

    Hello

    How to generate the sequence without gaps in oracle.
    Can you please explain, what would happen I create sequence with nocache option.
    Thank you

    Hello

    Try not to use cache creating oracle sequences

    See you soon
    Kanchana

  • generate unique sequential IDS for a record to be displayed in HTML

    Hello

    How do you have

    generate unique sequential IDS for a record to be displayed in HTML

    Yes, let me correct my statement. It is not true that an error will be generated if you did not have a trigger in place. You can simply include it directly in the insert statement. Under the following assumptions that a sequence had all ready been created for this table.

    Method 1:

    First, you must create the sequence:

    create sequences emp_no_seq.

    By default, it increments of 1, starting at 0.

    Use its values when data is inserted in the table:

    insert into the emp

    (emp_id, name)

    values

    (emp_no_seq.nexval, "Bill Smith");

    Then, copy the following code works fine and your examples are correct.

    You may need to configure the triggers. Check with your Oracle DBA.

    Method 2:

    create sequence product_seq with increment of 1 1
    /
    create or replace trigger product_insert before insert to start each line
    Select productseq.nextval
    in: new.product_id
    Double;
    end;
    /

    Insert into the product

    (product_id, product_type)

    values

    (productseq.nextval, "Monitor");

    Using the trigger on the DML (data manipulation language) when the product
    table is an insert command of the trigger fires. The trigger can give you more
    rules and specificity around this action and may have so so otherwise the conditions if necessary.

    RazorTrak
    SR Web Applications architect.,.
    Certified Macromedia ColdFusion MX Developer Advanced

  • How to clear the cache of firefox

    How to clear the cache of firefox

    Settings-Advanced below 'Network' and clear here

    https://support.Mozilla.org/ru/KB/Kak-ochistit-KESH-Firefox?redirectlocale=ru & redirectslug = Kak-ochistit-Kesh

  • Qosmio X 870 - 13p - how to restore the original key elements?

    Use the volume buttons + /-on the keyboard, I just had to push for example to increase the volume of your PC or put a song on a break. Now it does not work, I have to press the "Fn key" to use these keys.

    If anyone has an idea how to restore the original key elements?

    There are two options for the mode of function keys:
    -special function mode (you don't need to press the FN key n)
    -standard mode of F1 - F12

    Please check which option is set to your laptop.
    You can find it when you open the office assist > system settings > keyboard.

    Check and if necessary change the special function mode.

  • How to lock and unclock key FN?

    Hi, I have a laptop HP Pavilian DV7, and I wanted to know how to lock the function key. I saw in other websites that say just keep it pressed, press fn + NumLock, fn + F11 and fn + scroll, but none of those who work for me. Can someone help me please?

    lock the key Fn in the sense you use the function keys (F1, F2, F3...) + FN key combinations without using the FN key then the simple way of locking of the fn's boot in the bios by using the F10 key at startup which is used on most computers laptops hp, then in the bios screen select the option configuration. under the system configuration, you will find something like mode of action keys and make it active and then save the changes and exit the bios screen. hope that the problem will be solved on restart for unlock get in the bios screen and disable the action mode keys.

Maybe you are looking for

  • with a Wi - Fi access point

    We have a LaserJet 200 M276nw and a Hotspot from Verizon as our wireless provider.  The printer to reconnect to the wireless when we the hotspot turning back on after being off.  How to make it connect automatically when I turn on the hotspot?

  • Description corrupted on Toshiba HDD

    Today after I restarted my laptop I warned that a new driver with the corrupt desription "T E E E PY Q W A 1 (1-1 @" p/q;) " ' p + ' installed on my computer. After checking the Device Manager, I saw to my surprise that it is in fact my Toshiba "" MQ

  • How to get the license for end user to the BT stack?

    How can I get a license of end-user for BT stack worm 5? Thank you!

  • only Tx for a period of time?

    Hi all I have a few implemeing wrong with what should be a simple feature in one of the examples (niUSRP EX PSK Tx). I wish I had certain amount defined by the user to time Tx and "time-out." The question I have, is that during my time 'wait', the Tx

  • 0:80240022 error code

    Windows Defender Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the