Creating cache for multiple property files run time/dynamically.

Hi,
I have a requirement, where in I need to create cache for each property file present in a folder at server side or in the lib or resources directory. Please help me how I can do this?
Thanks.

ok thank you.
I follwed this method implementation:
static HashMap<String, HashMap<Object, String>> cacheHolder = new HashMap<String, HashMap<Object, String>>();
     static HashMap<Object, String>[] cache = new HashMap[2];
     static Integer fileCount = 0;
     static int incrementSize = 2;
public method1(Map<Object,String>map){
File file = new File((new StringBuilder(
                         "ABC/XYZ/")).append(value)
                         .toString()); // where value is the file name returned from the external method
               int newSize = existingMapLength+incrementSize;
               if (someVal== null) {                    
                    synchronized (fileCount) {
                         int oldSize = cache.length;
                         if(fileCount==cache.length){
                              HashMap[] oldData = new HashMap[oldSize];
                              oldData = cache;                              
                              cache = new HashMap[newSize];
                              LOGGER.info("New Size added:==>"+cache.length);
                              for(int i=0;i<oldSize;i++){                                   
                                   cache[i] = oldData;
                              cache[fileCount] = readExternalPropertiesFile(file); // external method which returns the properties of the file in hashmap
                              cacheHolder.put(value, cache[fileCount]);                    
                              keys = cache[fileCount].keySet();
                         else{                         
                         cache[fileCount] = readPropertiesFile(file);
                         cacheHolder.put(value, cache[fileCount]);                    
                         keys = cache[fileCount].keySet();
                         someVal= cache[fileCount];
fileCount = fileCount + 1;
Please let me know if any improvemnets are possible.

Similar Messages

  • How to config a shared cache for multiple environments with C API

    How to config a shared cache for multiple environments with C API?  Just like Java edition. Chapter 2. Database Environments
    I want to open large number of databases, at least 10,000. But as the counts of databases opened increase, the db->open operation become very slow. It almost cost 2 hours to 10,000 databases.
    So I try to distribute these databases to multiple environments ( for example, 5 envs ). And in order to improve the efficient of memory use, I want to share cache between envs.

    Hi,
    It is not clear what you meaning about multiple environments. Do you mean these environments are in different directories or  in the same directory ? If you mean environments in different dirs share the same cache, it is interesting why you need that.
    If you do not use DB_PRIVATE to open the environment, the created cache will be on disk, in the environment directory, so it can be shared by multiple processes and multiple threads. Currently, the cache file is in the environment directory, and we do not support specifying a separate directory for cache only.
    Regards,
    Oracle Berkeley DB.

  • Open module for managing property file and environment variables

    Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
    Any ideas are greatly welcomed.

    You seem wright, you hit a brick wall here with Air to find the location
    of the command console on windows...
    So in fact I never build an exe tool, but this little problem was a nice
    case to test it and I tried it.:
    I downloaded monodevelop
    -GTK# for .NET 2.12.10*
    -MonoDevelop 2.4.2*
       from http://monodevelop.com/Download
    created a console project and had an exe in 5 minutes !
    You can download the findconsole tool and the projectfiles here:
       http://greencollective.nl/temp/dump/findconsole_monoproject.zip
    findconsole.exe will reveal the path/location of cmd.exe on a windows system.
    Cheers,
    Latcho

  • How to build sql query for view object at run time

    Hi,
    I have a LOV on my form that is created from a view object.
    View object is read-only and is created from a SQL query.
    SQL query consists of few input parameters and table joins.
    My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
    Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
    Thanks
    Srikanth Addanki

    As I understand you want to change the query at run time.
    If this is what you want, you can use setQuery Method then use executeQuery.
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_

  • Can we change [maximum number of records per page] property at run time

    can we change [maximum number of records per page] property at run time in report 6i

    Ravi,
    I hope you are already done with this. In the invoice there is a nice example you can use on the xml blogs.
    You limit the number of lines per page when you use the xsl commands like this in your template:
    <xsl:variable name="lpp" select="number(13)"/>
    <?for-each@section:LIST_G_INVOICE?>
    <xsl:variable xdofo:ctx="incontext" name="invLines" select=".//G_LINES[LINE_TYPE='LINE']"/>
    <?for-each:$invLines?> <?if:(position()-1) mod $lpp=0?> <xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
    and then you have the table where you have the data
    <?for-each:$invLines?><?if:position()>=$start and position()<$start+$lpp?>
    and all your lines
    and then
    <?end if?><?end for-each?>

  • HOWTO: Control Printer Attributes for a Report at Run Time Reports 6i

    HOWTO: Control Printer Attributes for a Report at Run Time
    Like page width , height etc
    my problem is i had installed a printer and it is set for
    printing different reports ( like invoice slips , legal size ,
    A3 etc ) each time i have to manually set the page settup from
    printer folder .instead if there is an option to set the printer
    attributes from Reports 6i it is great
    rajesh

    All the Printer Setup(Page Height and Page Width) must be set in
    the Reprot Program. These can be set at the Layout-Main Section
    in the Object Navigator.
    hth

  • How to improve the speed for backing up files to time capsule via in hose wifi?

    How to improve the speed for backing up files to time capsule via in hose wifi?

    via in hose wifi?
    Use a bigger hose??
    House??
    Need to spell this out a bit more..
    But speed via 2.4ghz to the TC is restricted by Apple to max 130mbps link speed.. much slower actual transfer.. latest TC and laptops can do 450mbps on 5ghz but you need to be up close.. so place the TC near the device using it.. and force 5ghz connection by using a different name for 5ghz network.

  • Create Invoice for multiple deliveries

    Hi ,
    I want to create Invoice for multiple deliveries thru my prog.
    I tried using RV_INVOICE_CREATE but it creates multiple invoices if I enter multiple deliveries.
    I tried searching the forum but cud not get any solution for this.

    Hi,
    U can create single invoice for multiple deliveries if the following conditions are met
    1)payment terms are same
    2)billing dates are all same
    3)and Payer
    Go to VF01 and enter all the delivery document numbers and it will create a single invoice.
    Or else goto VF04 and search all delivery documents,select it and click on collective billing document button. One single invoice will be created
    regards.

  • Create confirmation for multiple cost objects PO in SUS

    Hi,
    Is it possible to create confirmation for multiple cost objects PO ( order type 'MA') in SUS ?
    We are going to implement SRM 7.
    Thanks & regards,
    Afandi-

    Hi All,
    First of all, thanks for your responses..
    Right, about the issue, what I explained here was that I am indeed assigning only one cost object: the WBS element. The issue was that even though I am assigning only the WBS element, it was also assigning the cost to the cost center by default. I did some R&D and found the solution to the issue (I was also asked to look for OSS notes but was not satisfied that this issue needs an OSS note to be applied so tried my solution). The issue was in table: T788M (allocate costs to variable account assignment). Here, I created an entry and called it USERGROUP_2 (just a random name) and assigned the variable cost objects (only the WBS and the Cost center) to be displayed. In the next step, I assigned this usergroup to the country in quesion feature (TRVCO). By doing this, I tell the system that only these cost objects are to be considered when an employee wants to assign the cost object. If the system sees that there is no value from the drop down to choose from, it picks up the default cost object (cost center). This was a simple issue that I had to rattle my brains on... but the solution I mention above worked like a hot knife going through butter...
    If you guys face this issue, please try this else feel free to get in touch with me on my number below.
    Once again, thanks for your responses.
    Best regards,
    Tanmay Dhingra
    +91 880 6666 606

  • Creating Authorization for multiple plants

    Hi,
    I have one requirement that, Creating Authorization for multiple plants
    SELECT-OPTIONS:    s_werks FOR mseg-werks.
        AUTHORITY-CHECK OBJECT 'M_MSEG_WMB' 
               ID 'ACTVT' FIELD '03'
               ID 'WERKS' FIELD s_werks.
    1. If have no of plants in s_werks then how to authorize the plants?
    2.if i dont enter any plant in my selection screen how to authorize that?
    3. if i have 5 plant only then how i can authorize those perticular plants only?
    Thanks in advance,
    Thanks,
    DP.

    S_WERKS is not a field; it's a set of fields.  Use simple ABAP to select your plants and loop at the selection(s) to check...

  • How to create a dynamic SSIS package for multiple flat file destinations

    Hi,
    I have to create a ssis package which has single data flow task and inside that I have 23 source (sql- select * from - statements)- destination (flat files, 23 distinct) connection.
    Now for each product I have to create separate SSIS package (i.e. if prod=abc then these read select * from abc_tables and 23 abc_ txt files)
    I want to do it dynamically, means only single package and inside that variables will take select * values for each source-dest connection (so i believe 23 variables) and same for destination flat files.
    Let me know. :)
    ANK HIT - if reply helps, please mark it as ANSWER or helpful post

    Sorry It seems you're contradicting yourself. you say I know my source and dest structure and the you're
    asking all I want is to have a dynamic structure
    what does that mean?
    and reading your next sentence
    I want to run a package for 5 products, instead of creating 5 ssis packages with 23 source- dest connection, I would
    like to have one with only 23 source- dest connections 
    What I feel is what you're looking for is to  have a looping structure to loop through each of the 5
    products.
    In that case what you could do is this
    1. Create a object variable in SSIS 
    2. Use a Execute SQL Task to populate the variable with all available products (I think you'll have a master table for that). Set ResultSet property to Full ResultSet and then in ResultSet tab map Object variable to 0 th index
    3. use a ForEachLoop container with ADO .NET recordset enumerator and map to object variable. Create a variable of datatype same as that of Product identifier field to get individual values out
    4. Inside loop create your data flow task with 23 source destination connection. In the query part use a parameter for product field and map it to the variable containing product value to get only data for the product.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Are there any workarounds for multiple PDF files created for a single Word 2011 document?

    I am running...
    Mac OS X Version 10.6.8
    Word for Mac 2011
    Adobe Acrobat X Version 10.1.0
    I am working with 100 plus page Word documents that go back and forth between portrait and landscape layouts. When I attempt to create an Acrobat PDF document (or one using the native Mac PDF function), I end up with 10 to 15 separate PDF documents. One person suggested that I simple stitch them together, which is an inordinate amount of work as compared to how simple it is do on my PC with older versions of Acrobat and Word. However, I have noticed that the margins are way off and the pagination is off sometimes too. So even this workaround is not the answer. I last talked to Microsoft, Apple, and Acrobat tech support about five weeks ago. Each blaming the other two but saying they were working together to solve the problem. My recent searches of forums has not revealed any solutions nor have updates changed anything.
    As I am anticipating the day when my old PC stops working, I am searching for a possible workaround or other solution for this problem.

    Thanks for your reply.
    The tip-off may be this.  In Word 2007 on my pc when I print the document to a printer, Word generates 1 print file for the entire document. If I print to PDF, one print file is generated by Word and Acrobat creates a PDF from this file.
    What I just discovered by accident was that when Word for Mac 2011 prints the same Word document to a printer it creates about 10 different print files.  So instead of a 100 page PDF document I end up with 10 PDF documents of 1 to 30 pages depending where the page orientation shifts in the Word document. If you print to a printer that is not turned on, you can see all of the files stacked up in the printer queue. I suspect that Word for Mac 2011 generates 10 different print files during the PDF creation process and therefore Acrobat logically creates 10 different PDFs.  Unfortunately, there are margin errors and other layout errors in these 10 different PDFs so stitching them together is useless.
    I am beginning to think that the way Word for Mac 2011 prints documents is simply incompatabile to Acrobat or the PDF creator that is native to the Mac OS.
    I just think that this is a problem that Microsoft is going to have to fix.

  • Photoshop Elements Organizer 11 crashes due to deadlock in the thread wait chain when creating thumbnails for *.mts (AVCHD) files

    Hi,
    the Elements Organizer 11 creates a deadlock in the wait chain when generating thumbnails for more than a handful of MTS (AVCHD) files.
    After importing AVCHD files from my Canon video camera, the organizer using default settings always crashes. I was able to narrow down the problem to be caused by thumbnail generating.
    After deactivating the automatic generation of thumbnails, the organizer does not crash any more upon launching .
    Of course, working without thumbnails is not very practical. The next resort is manual trigger of thumbnail generation by selecting "update thumbnail".
    If I manually trigger updating of thumbnails for files one by one, then it works for quite many files before crashing again.
    Selecting thumbnail update for multiple files at once has a much higher likelihood to crash.
    This does not seem to be related to particular file contents: a file that leads to crashing once may be flawlessly get a thumbnail created at the next attempt.
    The Windows event report looks as follows (German language Windows):
    Name der fehlerhaften Anwendung: PhotoshopElementsOrganizer.exe, Version: 11.0.0.0, Zeitstempel: 0x505e9f67
    Name des fehlerhaften Moduls: msvcrt.dll, Version: 7.0.9600.16384, Zeitstempel: 0x52158ff5
    Ausnahmecode: 0xc0000005
    Fehleroffset: 0x00009919
    ID des fehlerhaften Prozesses: 0x13c8
    Startzeit der fehlerhaften Anwendung: 0x01cfb676145d0c54
    Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\Adobe\Elements 11 Organizer\PhotoshopElementsOrganizer.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\msvcrt.dll
    Berichtskennung: b8817e29-2269-11e4-bf2d-10bf487f7b28
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    Occasionally, a different module is listed as erroneous instead of msvcrt.dll.
    My questions:
    - has anyone experienced the same problem?
    - is this a known issue with Organizer 11?
    - is the issue solved with Organizer 12?
    I have Premiere Elements 11, Photoshop Elements 11 installed and not experienced any other issues with these applications.
    Playback of said AVCHD (*.mts) files works flawlessly, i.e. I do not have any codec or performance issue on my PC.
    Deactivation of anti-virus software has no significant effect. I have excluded video directories from scanning anyways.
    Have deactivated face recognition, visual search and smart tagging in the organizer.
    Have also disabled hyperthreading in the BIOS.
    Using Windows XP compatibility settings for PSE somewhat improved the stability, but did not completely eliminate crashes.
    Additionally, it signnificantly slows down thumbnail generation and a progress indication window becomes visible during thumbnail generation, which is barely noticable in native Win 8.1 mode.
    Officially, Elements 11 is compatible with Windows 8.1.
    There is a knowledgebase article related to Elements 6, which recommends to disable multi-threading and to enforce execution of Organizer on more than one core.
    This reduces the problem a little bit, but thumbnailing more than a handful of files still leads to crashing.
    By means of the task manager, I analyzed the wait chain of the process PhotoshopElementsOrganizer.exe:
    Every time the fault occurs, it is caused by a deadlock in the wait chain.
    For example:
    PhotoshopElementsOrganizer.exe (PID:6440) Thread: 6540
    -- PhotoshopElementsOrganizer.exe (PID:6440) Thread: 5932
    ---- PhotoshopElementsOrganizer.exe (PID:6440) Thread: 6540
    PhotoshopElementsOrganizer.exe (PID:6440) Thread: 5932
    -- PhotoshopElementsOrganizer.exe (PID:6440) Thread: 6540
    ---- PhotoshopElementsOrganizer.exe (PID:6440) Thread: 5932
    Regards
    Oliver
    Microsoft Windows 8.1 Pro, 64bit, 6.3.9600 Build 9600
    Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz,
    16 GB RAM
    AMD Radeon HD5450, 1GB
    256 GB SSD,  Crucial M4-CT256 (Windows, Application, Swap and Temp files), NTFS
    1.8 TB HDD, WesternDigital, WD2002FAEX-007BA0, NTFS  (media store)

    Hi,
    I'm experiencing the same problem after importing MTS files.
    When you said that you unisntall all other codec, what do you mean?
    Codec Inside element software?
    I have desable the automatic thumbnail and it still crash.
    I'M running the software and trying to import more video files and the program keep crashing during the process of selecting the files in the directory to be imported.
    i went in my windows 7 journal and here is the error.
    System
    Provider
    [ Name]
    Application Error
    EventID
    1000
    [ Qualifiers]
    0
    Level
    2
    Task
    100
    Keywords
    0x80000000000000
    TimeCreated
    [ SystemTime]
    2014-08-31T19:36:04.000000000Z
    EventRecordID
    244366
    Channel
    Application
    Computer
    Ordi-Denis
    Security
    EventData
    PhotoshopElementsOrganizer.exe
    11.0.0.0
    503fdd1d
    MSACM32.dll
    6.1.7600.16385
    4a5bda4e
    c0000005
    00004d91
    1634
    01cfc552c927dce5
    C:\Program Files (x86)\Adobe\Elements 11 Organizer\PhotoshopElementsOrganizer.exe
    C:\Windows\system32\MSACM32.dll
    0b097e53-3146-11e4-a14e-bcaec51a14f7
    Please i need help since Adobe is not helping us.

  • Triggering a sub work flow for multiple users at same time.

    I have a scenario in which I have created sub workflow as an activity for approval process. This sub work flow should be triggered for multiple users at the same time and their decison is independent of each other.
    This is like creating multipe instance of the same sub work flow and then the sub work flow runs indepedently as a new work flow for each of the approver and the process is completeded for approver independently.
    How can this be achieved?

    Tyr to do like this,
    1. First include the subworkflow in the main workflow template.
    2. Now include standard Block Step in the main workflow template.
    3. In the block select the block type as ParForEach.
    4. Before doing the 3rd point make sure that all the agents for whom you want whom you want to initiate the workflow, populate them in a Multiline conatiner element.
    5. Once completing 3rd and 4th points open the block step under the tab ParallelProcessing  assign the multiline container element name in the   for e;g if the multi line container element name is COSTCENTER then do the binding like below. the conatiner element COSTCENTERLINE is created by default once you include the multi line conatiner element under parller processing tab.
    &COSTCENTER[&_WF_PARFOREACH_INDEX&]&   -------->     &_COSTCENTER_LINE&
    Now assign the agent of the subworkflow as COSTCENTERLINE , imean if suppose you have 3 entries in the internal table then three separate and for three different agents the workflow is instantiated.

  • Need Preloader for Multiple SWF files

    SORRY FOR THE DUPE POST, THE OTHER CAN BE DELETED. MY ADOBE
    ID PROFILES WERE MESSED UP.
    Hi forums, I'm new to Flash. I did the following:
    1. Created a complex home page, about 3.5MB in size, due to a
    large graphic I had to use many times over and couldn't make into a
    symbol (long story). It's called INDEX.SWF, with accompanying
    INDEX.HTML file from Flash
    2. Split pieces of the INDEX.SWF file into multiple SWF files
    to make it load faster
    3. Created multiple layers in INDEX.SWF using loadMovieNum to
    call to multiple SWF files from step 2
    This works OK, but I think a preloader would optimize my page
    animation. However:
    1. I don't understand how a preloader file gets recognized on
    the site load. If I create a file called PRELOADER.FLA and publish
    it, how does the site know to use it first? Does it need a special
    name?
    2. Once I understand #1 above, I might be able to use some
    sample preloader files I've found. It seems like all I have to do
    is change the actionscript to point to my main file, but not sure
    yet. I'll get to that next once I understand how the file even gets
    recognized and loaded. Thanks for your help!

    PLEASE DELETE THIS POST AND USE NEWER ONE FROM
    MOUSEHOUSESITE, I APOLOGIZE FOR DUPE POST DUE TO MESSED UP ADOBE
    ID.

Maybe you are looking for