Data Pre Load

Hi,
I have two servers with Server 1 and Server 2(I mean two different machine) and both the servers are configured with Distributed cache. For example Server 1 have a cache name "ABC" and Server 2 have a cache name "XYZ".
I want to pre load the same data to both the servers with different cache names and my JOB java class is pointing to tangosol override file for Server 1.
How can I load the data to server 2 with server 1 tangosol override file?
I dont want to use push replication patteren.
Thanks,
Raj.

Hi Raj
You cannot get the storage enabled members from an Extend client as the cache service will be a RemoteCacheService or more likely a SafeCacheService wrapping a RemoteCacheService.
I am not sure I follow exactly what you are trying to achieve from your posts above.
Why do you want to get the storage enabled members - is is so that you can make the same call invocationService.execute(task,Collections.singleton(members.toArray()[0]), null); to cluster two from cluster one?
If you want to do this then you need two invocable, one is LoaderInvocable class you mention above and the other looks like this:
public class RemoteLoaderInvocable extends AbstractInvocable {
    private String cacheName;
    private String springBeanId;
    public RemoteLoaderInvocable() {
    public RemoteLoaderInvocable(String cacheName, String springBeanId) {
        this.cacheName = cacheName;
        this.springBeanId = springBeanId;
    @Override
    public void run() {
        NamedCache cache = CacheFactory.getCache(cacheName);
        Set<Member> memberSet = ((PartitionedService) cache.getCacheService()).getOwnershipEnabledMembers();
        Member[] members = memberSet.toArray(new Member[memberSet.size()]);
        LoaderInvocable task = new LoaderInvocable(cacheName,springBeanId);
        getService().query(task, members);
}You would need to make the above class properly implement POF of whatever you are using for serialization.
You then declare a remote invocation scheme like you have for the remote cache scheme in cluster 1
<remote-invocation-scheme>
    <scheme-name>tier-2-proxy-invocation-scheme</scheme-name>
    <service-name>ExtendTcpProxyInvocationService</service-name>
    <initiator-config>
        <tcp-initiator>
            <remote-addresses>
                <socket-address>
                    <address>localhost</address>
                    <port>6005</port>
                </socket-address>
            </remote-addresses>
            <connect-timeout>20s</connect-timeout>
        </tcp-initiator>
        <outgoing-message-handler>
            <request-timeout>20s</request-timeout>
        </outgoing-message-handler>
    </initiator-config>
</remote-invocation-scheme>Then in cluster1 you can do...
InvocationService cluster2Service = CacheFactory.getService("ExtendTcpProxyInvocationService");
service.query(new RemoteLoaderInvocable(cacheName, springBeanId), null);That will allow you to execute your LoaderInvocable from cluster 1 against storage enabled members in cluster 2, but as I said, I don't see what you are really trying to do.
JK

Similar Messages

  • How syncronize with the data base after pre-loading the data

    Hi,
    I have pre-loaded the data from the database table into the cache.
    If the key is not found in the cache i want to it to connect to database and get the value from the table. How to achieve this?

    Hi JK,
    I have pasted my cache loader code, config file and the main class in the other post but i m not sure what is the issue with it. Its not working. Please can you tell me what might be the issue with that piece of code. I m not getting any exception either but the load() or loadAll() method is not at all getting triggered on invoking cache.get() or cache.getAll() method. What might be the cause for this issue?
    Can you give me the coherence-cache-config.xml contents?
    I m not sure whether its the issue with the config file because i have read some where that refreshaheadfactor is required to trigger the loadAll() method.
    Edited by: 943300 on Jul 4, 2012 9:57 AM

  • Pre-loading a table, populating data

    hopefully someone has already crossed this bridge,
    does anyone know how to pre-load a table and then populate the data returned from a query? I have seen websites like ingrammicro.com that display the results from a search where you can see the table and some of the data , and then slowly you start seeing pricing populated within the table. maybe this is more of an HTML question.not sure. thanks for any information you can give.
    thanks, Tim

    yes, that will work. thanks.

  • Pre-loading Oracle text in memory with Oracle 12c

    There is a white paper from Roger Ford that explains how to load the Oracle index in memory : http://www.oracle.com/technetwork/database/enterprise-edition/mem-load-082296.html
    In our application, Oracle 12c, we are indexing a big XML field (which is stored as XMLType with storage secure file) with the PATH_SECTION_GROUP. If I don't load the I table (DR$..$I) into memory using the technique explained in the white paper then I cannot have decent performance (and especially not predictable performance, it looks like if the blocks from the TOKEN_INFO columns are not memory then performance can fall sharply)
    But after migrating to oracle 12c, I got a different problem, which I can reproduce: when I create the index it is relatively small (as seen with ctx_report.index_size) and by applying the technique from the whitepaper, I can pin the DR$ I table into memory. But as soon as I do a ctx_ddl.optimize_index('Index','REBUILD') the size becomes much bigger and I can't pin the index in memory. Not sure if it is bug or not.
    What I found as work-around is to build the index with the following storage options:
    ctx_ddl.create_preference('TEST_STO','BASIC_STORAGE');
    ctx_ddl.set_attribute ('TEST_STO', 'BIG_IO', 'YES' );
    ctx_ddl.set_attribute ('TEST_STO', 'SEPARATE_OFFSETS', 'NO' );
    so that the token_info column will be stored in a secure file. Then I can change the storage of that column to put it in the keep buffer cache, and write a procedure to read the LOB so that it will be loaded in the keep cache. The size of the LOB column is more or less the same as when creating the index without the BIG_IO option but it remains constant even after a ctx_dll.optimize_index. The procedure to read the LOB and to load it into the cache is very similar to the loaddollarR procedure from the white paper.
    Because of the SDATA section, there is a new DR table (S table) and an IOT on top of it. This is not documented in the white paper (the white paper was written for Oracle 10g). In my case this DR$ S table is much used, and the IOT also, but putting it in the keep cache is not as important as the token_info column of the DR I table. A final note: doing SEPARATE_OFFSETS = 'YES' was very bad in my case, the combined size of the two columns is much bigger than having only the TOKEN_INFO column and both columns are read.
    Here is an example on how to reproduce the problem with the size increasing when doing ctx_optimize
    1. create the table
    drop table test;
    CREATE TABLE test
    (ID NUMBER(9,0) NOT NULL ENABLE,
    XML_DATA XMLTYPE
    XMLTYPE COLUMN XML_DATA STORE AS SECUREFILE BINARY XML (tablespace users disable storage in row);
    2. insert a few records
    insert into test values(1,'<Book><TITLE>Tale of Two Cities</TITLE>It was the best of times.<Author NAME="Charles Dickens"> Born in England in the town, Stratford_Upon_Avon </Author></Book>');
    insert into test values(2,'<BOOK><TITLE>The House of Mirth</TITLE>Written in 1905<Author NAME="Edith Wharton"> Wharton was born to George Frederic Jones and Lucretia Stevens Rhinelander in New York City.</Author></BOOK>');
    insert into test values(3,'<BOOK><TITLE>Age of innocence</TITLE>She got a prize for it.<Author NAME="Edith Wharton"> Wharton was born to George Frederic Jones and Lucretia Stevens Rhinelander in New York City.</Author></BOOK>');
    3. create the text index
    drop index i_test;
      exec ctx_ddl.create_section_group('TEST_SGP','PATH_SECTION_GROUP');
    begin
      CTX_DDL.ADD_SDATA_SECTION(group_name => 'TEST_SGP', 
                                section_name => 'SData_02',
                                tag => 'SData_02',
                                datatype => 'varchar2');
    end;
    exec ctx_ddl.create_preference('TEST_STO','BASIC_STORAGE');
    exec  ctx_ddl.set_attribute('TEST_STO','I_TABLE_CLAUSE','tablespace USERS storage (initial 64K)');
    exec  ctx_ddl.set_attribute('TEST_STO','I_INDEX_CLAUSE','tablespace USERS storage (initial 64K) compress 2');
    exec  ctx_ddl.set_attribute ('TEST_STO', 'BIG_IO', 'NO' );
    exec  ctx_ddl.set_attribute ('TEST_STO', 'SEPARATE_OFFSETS', 'NO' );
    create index I_TEST
      on TEST (XML_DATA)
      indextype is ctxsys.context
      parameters('
        section group   "TEST_SGP"
        storage         "TEST_STO"
      ') parallel 2;
    4. check the index size
    select ctx_report.index_size('I_TEST') from dual;
    it says :
    TOTALS FOR INDEX TEST.I_TEST
    TOTAL BLOCKS ALLOCATED:                                                104
    TOTAL BLOCKS USED:                                                      72
    TOTAL BYTES ALLOCATED:                                 851,968 (832.00 KB)
    TOTAL BYTES USED:                                      589,824 (576.00 KB)
    4. optimize the index
    exec ctx_ddl.optimize_index('I_TEST','REBUILD');
    and now recompute the size, it says
    TOTALS FOR INDEX TEST.I_TEST
    TOTAL BLOCKS ALLOCATED:                                               1112
    TOTAL BLOCKS USED:                                                    1080
    TOTAL BYTES ALLOCATED:                                 9,109,504 (8.69 MB)
    TOTAL BYTES USED:                                      8,847,360 (8.44 MB)
    which shows that it went from 576KB to 8.44MB. With a big index the difference is not so big, but still from 14G to 19G.
    5. Workaround: use the BIG_IO option, so that the token_info column of the DR$ I table will be stored in a secure file and the size will stay relatively small. Then you can load this column in the cache using a procedure similar to
    alter table DR$I_TEST$I storage (buffer_pool keep);
    alter table dr$i_test$i modify lob(token_info) (cache storage (buffer_pool keep));
    rem: now we must read the lob so that it will be loaded in the keep buffer pool, use the prccedure below
    create or replace procedure loadTokenInfo is
      type c_type is ref cursor;
      c2 c_type;
      s varchar2(2000);
      b blob;
      buff varchar2(100);
      siz number;
      off number;
      cntr number;
    begin
        s := 'select token_info from  DR$i_test$I';
        open c2 for s;
        loop
           fetch c2 into b;
           exit when c2%notfound;
           siz := 10;
           off := 1;
           cntr := 0;
           if dbms_lob.getlength(b) > 0 then
             begin
               loop
                 dbms_lob.read(b, siz, off, buff);
                 cntr := cntr + 1;
                 off := off + 4096;
               end loop;
             exception when no_data_found then
               if cntr > 0 then
                 dbms_output.put_line('4K chunks fetched: '||cntr);
               end if;
             end;
           end if;
        end loop;
    end;
    Rgds, Pierre

    I have been working a lot on that issue recently, I can give some more info.
    First I totally agree with you, I don't like to use the keep_pool and I would love to avoid it. On the other hand, we have a specific use case : 90% of the activity in the DB is done by queuing and dbms_scheduler jobs where response time does not matter. All those processes are probably filling the buffer cache. We have a customer facing application that uses the text index to search the database : performance is critical for them.
    What kind of performance do you have with your application ?
    In my case, I have learned the hard way that having the index in memory (the DR$I table in fact) is the key : if it is not, then performance is poor. I find it reasonable to pin the DR$I table in memory and if you look at competitors this is what they do. With MongoDB they explicitly says that the index must be in memory. With elasticsearch, they use JVM's that are also in memory. And effectively, if you look at the awr report, you will see that Oracle is continuously accessing the DR$I table, there is a SQL similar to
    SELECT /*+ DYNAMIC_SAMPLING(0) INDEX(i) */    
    TOKEN_FIRST, TOKEN_LAST, TOKEN_COUNT, ROWID    
    FROM DR$idxname$I
    WHERE TOKEN_TEXT = :word AND TOKEN_TYPE = :wtype    
    ORDER BY TOKEN_TEXT,  TOKEN_TYPE,  TOKEN_FIRST
    which is continuously done.
    I think that the algorithm used by Oracle to keep blocks in cache is too complex. A just realized that in 12.1.0.2 (was released last week) there is finally a "killer" functionality, the in-memory parameters, with which you can pin tables or columns in memory with compression, etc. this looks ideal for the text index, I hope that R. Ford will finally update his white paper :-)
    But my other problem was that the optimize_index in REBUILD mode caused the DR$I table to double in size : it seems crazy that this was closed as not a bug but it was and I can't do anything about it. It is a bug in my opinion, because the create index command and "alter index rebuild" command both result in a much smaller index, so why would the guys that developped the optimize function (is it another team, using another algorithm ?) make the index two times bigger ?
    And for that the track I have been following is to put the index in a 16K tablespace : in this case the space used by the index remains more or less flat (increases but much more reasonably). The difficulty here is to pin the index in memory because the trick of R. Ford was not working anymore.
    What worked:
    first set the keep_pool to zero and set the db_16k_cache_size to instead. Then change the storage preference to make sure that everything you want to cache (mostly the DR$I) table come in the tablespace with the non-standard block size of 16k.
    Then comes the tricky part : the pre-loading of the data in the buffer cache. The problem is that with Oracle 12c, Oracle will use direct_path_read for FTS which basically means that it bypasses the cache and read directory from file to the PGA !!! There is an event to avoid that, I was lucky to find it on a blog (I can't remember which, sorry for the credit).
    I ended-up doing that. the events to 10949 is to avoid the direct path reads issue.
    alter session set events '10949 trace name context forever, level 1';
    alter table DR#idxname0001$I cache;
    alter table DR#idxname0002$I cache;
    alter table DR#idxname0003$I cache;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0001$I;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0002$I;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0003$I;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0001$I ITAB;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0002$I ITAB;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0003$I ITAB;
    It worked. With a big relief I expected to take some time out, but there was a last surprise. The command
    exec ctx_ddl.optimize_index(idx_name=>'idxname',part_name=>'partname',optlevel=>'REBUILD');
    gqve the following
    ERROR at line 1:
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drftoptrebxch
    ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.CTX_DDL", line 1141
    ORA-06512: at line 1
    Which is very much exactly described in a metalink note 1645634.1 but in the case of a non-partitioned index. The work-around given seemed very logical but it did not work in the case of a partitioned index. After experimenting, I found out that the bug occurs when the partitioned index is created with  dbms_pclxutil.build_part_index procedure (this enables  enables intra-partition parallelism in the index creation process). This is a very annoying and stupid bug, maybe there is a work-around, but did not find it on metalink
    Other points of attention with the text index creation (stuff that surprised me at first !) ;
    - if you use the dbms_pclxutil package, then the ctx_output logging does not work, because the index is created immediately and then populated in the background via dbms_jobs.
    - this in combination with the fact that if you are on a RAC, you won't see any activity on the box can be very frightening : this is because oracle can choose to start the workers on the other node.
    I understand much better how the text indexing works, I think it is a great technology which can scale via partitioning. But like always the design of the application is crucial, most of our problems come from the fact that we did not choose the right sectioning (we choosed PATH_SECTION_GROUP while XML_SECTION_GROUP is so much better IMO). Maybe later I can convince the dev to change the sectionining, especially because SDATA and MDATA section are not supported with PATCH_SECTION_GROUP (although it seems to work, even though we had one occurence of a bad result linked to the existence of SDATA in the index definition). Also the whole problematic of mixed structured/unstructured searches is completly tackled if one use XML_SECTION_GROUP with MDATA/SDATA (but of course the app was written for Oracle 10...)
    Regards, Pierre

  • Adding a pre loader to an XML photo gallery between the photos.

    Hey,
    I have made a photogallery in actionscript 3 which uses an .XML file to import pictures. As the user clicks on the displayed image the code loads the next image in the cycle into the display. Now, I would like to add a preloader which displays the loading progress of each image as the user clicks (otherwise there is just a blank area as the image loads). I have made a pre-loader for the main .SWF but I can't figure out how to make it work for the images or how to make a seperate one for the images. The fact is that I am a bit of a muppet when it comes to AS3, and am finding myself getting lost an confused quite easily.
    I have attatched the .FLA if that helps any! If not then...
    here is the link to the .HTML page that contains the .swf:
    http://www.davidframpton.co.uk/portfolio.html
    Here is the code I am using for the main pre-loader held in frame 1:
    stop();
    addEventListener(Event.ENTER_FRAME, loaderF);
    function loaderF(e:Event):void {
        var toLoad:Number = loaderInfo.bytesTotal;
        var loaded:Number = loaderInfo.bytesLoaded;
        var total:Number = loaded/toLoad;
        if(loaded == toLoad) {
            removeEventListener(Event.ENTER_FRAME, loaderF);
            gotoAndStop(2);
        } else {
            preloader_mc.preloaderFill_mc.scaleX = total;
            preloader_mc.percent_txt.text = Math.floor(total * 100) + "%";
    And here is the code for the photogallery:
    stop();
    var xmlRequest:URLRequest = new URLRequest("http://www.davidframpton.co.uk/galleryData.xml");
    var xmlLoader:URLLoader = new URLLoader (xmlRequest);
    var imgData:XML;
    var imageLoader:Loader;
    var rawImage:String;
    var rawH:String;
    var rawW:String;
    var imgNum:Number = 0;
    var checkSec:Timer = new Timer(100);
    var numberOfChildren:Number;
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
    master_mc.addEventListener(MouseEvent.CLICK, nextImgF);
    master_mc.buttonMode = true;
    function xmlLoadedF(event:Event):void{
        checkSec.start();
        checkSec.addEventListener(TimerEvent.TIMER, checkerF);
        imgData = new XML(event.target.data);
    function packagedF():void{
        checkSec.removeEventListener(TimerEvent.TIMER, checkerF);
        rawImage = imgData.image[imgNum].imgURL;
        numberOfChildren = imgData.*.length();
        imageLoader = new Loader;
        imageLoader.load(new URLRequest(rawImage));
        master_mc.addChild(imageLoader);
    function checkerF(event:TimerEvent):void{
        if (imgNum == 0) {
            packagedF();
        }else if(imgNum < numberOfChildren){
            imageLoader.unload();
            packagedF();
        }else {
            imageLoader.unload();
            imgNum = 0;
            packagedF();
    function nextImgF(event:MouseEvent):void {
        checkSec.addEventListener(TimerEvent.TIMER, checkerF);
        imgNum++;
    I would really appreciate any help. Even if your could guide me to where I can learn how to do this myself in an simple fashion, I would be greatful.
    Thanks in advance
    Dave

    The Loader class has a contentLoaderInfo property that is a LoaderInfo class object.  You can assign an event listener to the contentLoader Info that listens for PROGRESS.  There is an example in the Loader class section that shows the contentLoaderInfo property being used for a variety of event detections, including PROGRESS.

  • Problems with the Oracle Pre-Load actions in an homogeneous system copy

    Hi,
    I am trying to do a NW04 homogeneous system copy, and I am having troubles with the ABAP copy. (Oracle Pre-Load Actions step)
    I am with the database specific procedure, so I am creating the new system until the sapinst asks me to bring an online-offline backup and the control file, then the sapinst tries to recover the database by himself, but he finds trouble:
    Error: CJS-00084 SQL statement or script failed.<br>DIAGNOSIS: Error message: ORA-01194: file 1 needs more recovery to be consistent Ora-01110: data file 1: 'oracle/XIE...'
    If I try to do the recover manually I have to make the usual:
    RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;
    CANCEL
    ALTER DATABASE OPEN RESETLOGS;
    If I follow the sapinst.log I find that the sapinst tries to recover the database but fails with the above message and:
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
    Yes, that's true, if I make it manually I have to open the database with the 'alter database open resetlogs';
    the problem could be fixed modifying the run_control.sql statement that the SAPINST creates at the working directory, but no modification to that statement is possible because the SAPINST deletes and creates the statement IMMEDIATELY before executing it, so what can I do?
    Many thanks
    Mario

    SOLVED
    for your info, the run_control.sql is UNMODIFIABLE, but I could modify the CONTROL.SQL that he calls, so I recovered manually the Database, and the CONTROL.SQL was a simply CONNECT and then OPEN DATABASE, just like that, so I could continue with my installation, another point for us against the damned SAPINST !!!

  • Pre-load servlets from a war-file

    Hello,
              is there a way to pre-load a servlet (or execute any other code)
              at server startup, when the application is deployed as a .war-file?
              I know how to use the weblogic.servlet.utils.ServletStartup and
              the weblogic.system.startupClass... property, but these two
              seem to require that the servlet (or application class, respectively)
              are found in the servlet classpath (or the weblogic.class.path,
              respectively), so these mechanisms cannot peek into war-files to find
              the class, am I right?
              The page http://www.weblogic.com/docs51/classdocs/webappguide.html#dtprops
              says:
              <load-on-startup>load_order</load-on-startup>
              (Optional) This property is not honored by WebLogic Server in this release.
              Is this still valid?
              Is there a workaround?
              When will this element be supported?
              Concerning a possible workaround, I have read:
              > Subject: Re: Pre-load
              > Date: Fri, 19 Nov 1999 14:38:41 -0500
              > From: Jeff Martin <[email protected]>
              > Newsgroups: weblogic.developer.interest.servlet
              > Tom Gerber wrote:
              > >
              > > How do you get your startup class to start? Do you have a
              > > script which calls your startup class via a URL? Or is
              > > there a setting in the weblogic properties file for it?
              > Starting WebLogic in unix is a shell script. Just add a line to run your
              > preload program (e.g. java Preload).
              > Some unixes have utilities to get a web page from the command line (to
              > do shell parsing on it); create a series of calls, one per page.
              That sounds like a possibility, but I do not understand exactly.
              1) Where do I have to put the line into the shell script?
              2) Which line is it?
              3) What is the UNIX utility?
              I am using WL 5.1 (evaluation) under Solaris.
              Any help appreciated,
                   Oliver Matz
              | _ \ / \ | __)( ) Oliver Matz, Engineer
              | _/( () )| __) | | fon: +49(0)40/60990-0
              |_| \__/ |___) |_| fax: +49(0)40/60990-113
              

    Yes you can load a java applet form a jar file.
    Here is the code for internet explorer.
    <body>
         <table align="center" border="1">
              <tr>
                   <td>
                        <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="10" height="10" codebase="/plugin/">
                        <param name="code" value="XXX.class">
                        <param name="archive" value="XXX.jar">
                        </object>
                   </td>
              </tr>
         </table>
    </body>
    </html>
    Just replace the XXX.class with the class containing the init() method and XXX.jar with the jar file.

  • Pre-loading the cache

    I'm attempting to pre-load the cache with data and have implemented controllable caches as per this document (http://wiki.tangosol.com/display/COH35UG/Sample+CacheStores). My cache stores are configured as write-behind with a 2s delay:
    <cache-config>
         <caching-scheme-mapping>
         <cache-mapping>
              <cache-name>PARTY_CACHE</cache-name>
              <scheme-name>party_cache</scheme-name>
         </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <distributed-scheme>
                <scheme-name>party_cache</scheme-name>
                <service-name>partyCacheService</service-name>
                <thread-count>5</thread-count>
                <backing-map-scheme>
                    <read-write-backing-map-scheme>
                         <write-delay>2s</write-delay>
                        <internal-cache-scheme>
                            <local-scheme/>
                        </internal-cache-scheme>
                        <cachestore-scheme>
                            <class-scheme>
                                <class-name>spring-bean:partyCacheStore</class-name>
                            </class-scheme>
                        </cachestore-scheme>
                    </read-write-backing-map-scheme>
                </backing-map-scheme>
                <autostart>true</autostart>
            </distributed-scheme>
         </caching-schemes>
    </cache-config>
    public static void enable(String storeName) {
            CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).put(storeName, Boolean.TRUE);
    public static void disable(String storeName) {
            CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).put(storeName, Boolean.FALSE);
    public static boolean isEnabled(String storeName) {
            return ((Boolean) CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).get(storeName)).booleanValue();
    public void store(Object key, Object value) {
            if (isEnabled(getStoreName())) {
                throw new UnsupportedOperationException("Store method not currently supported");
        }The problem I have is that what seems to be happening is:
    1) bulk loading process calls disable() on the cache store
    2) cache is loaded with data
    3) bulk loading process calls enable() on the cache store ready for normal operation
    4) the service thread starts to attempt to store the data as the check to see if the store is enabled returns true because we set it to true in step 3
    so is there a way of temporarily disabling the write-delay or changing it programatically so step 4 doesn't happen?

    Adding
    Thread.sleep(10000);after loading the data seems to solve the problem but this seems dirty, any better solutions?

  • Pre-loading the Cache from Database during application start-up

    We are using Spring, Hibernate, Oracle Coherence 3.5.2 Weblogic Webservices
    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that whenever user access that particular service he ends up hitting the Cache instead of database.
    We would greatly appreciate sample code snippets on how to write CacheInitializerBean with marker to demonstrate the state of cache.

    Hi Rob,
    Thanks for pointing to the article: Pre-Loading the Cache
    In fact i already looked at that article before posting. It just mentions how to load the data from database into Cache.
    What i am looking for is how to make this happen during application start-up. This is my first hurdle.
    The second one is as mentioned in the article http://coherence.oracle.com/display/COH35UG/Pre-Loading+the+Cache
    i wrote following code which never gets populated into cache. Not sure whats going wrong even though i see Hibernate loadAll() method loading all the objects in the console
    public   void populateCache() throws SQLException
        Map<Long, Object>  buffer = new HashMap<Long, Object>();
        int count = 0;
         List<Contract> contractList = this.getHibernateTemplate().loadAll(Contract.class);
         log.debug("contractList size="+contractList.size());
         for(Contract contract : contractList)
             Long key   = new Long(contract.getId());
             Object  value = contract;
             buffer.put(key, value);
             // this loads 1000 items at a time into the cache
             if ((count++ % 1000) == 0)
                  contractCache.putAll(buffer);
                 buffer.clear();
         if (!buffer.isEmpty())
              contractCache.putAll(buffer);
        }We would greatly appreciate your time in helping us resolving two hurdle blocks.

  • Pre-load the Cache during Application-Start Up

    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that when user access that particular service he ends up hitting the Cache instead of database.
    Any pointers/suggestions on how to pre-load the cache during application start-up would be greatly appreciated. We are using Spring, Hibernate, Weblogic Web Services
    Regards,
    Bansi

    Hi Bansi,
    I were using following approach.
    First, we never use CacheFactory.getCache() in application code instead all instances of named cache were injected.
    On server side, I have an CacheInitializerBean which were starting cache preloading process (in separate thread). After preloading a special marker entry were put to the cache, indicating what data in the cache are consistent.
    When injecting named cache instance, we use a factory. This factory use CacheFactory.getCache() internally, but it check presence of marker object in cache an blocks until marker object will appear.
    Well in practice things are little more complicated but this is basic idea.
    Preload cache asynchronously and use marker to indicate completion of loading process.
    Hope this will help.
    Regards,
    Alexey

  • LocalCache - pre-load config set to true

    Hi,
    I have set the <pre-load> to true for local cache configuration. My CacheStore implements 'IterableCacheLoader'.  When I make a call to, ---
    (call 1) . NamedCache cache = CacheFactory.getCache("cacheName");
    'loadAll()' of CacheStore is invoked. 'loadAll()' returns Map which has required key-value pairs.How do I put this returned Map into NamedCache? The reason I am asking this is call1 is  made in different package from CacheStore.
    Does not loadAll() implicitly update the NamedCache?
    The requirement is to preload the data and this standalone local cache.

    To use the Google's browse by name feature as used in Firefox 3.6, set keyword.URL to this link:
    [http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q= http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=]

  • Pre-loading images loaded from XML.

    Hello,
    I hoping for some guidance please.
    I have a Gallery that loads thumbnails from an XML.
    I have added a pre-loader to each one of the thumbnails as it is being loaded from the XML.
    My problem is that I can't figure out how to remove the pre-loaders after it has called the Event.COMPLETE.
    With my curent code,
    As it completes loading the thumbnails, it throws an error and only removes the very last pre-loader.
    Thanks for any help you can provide.
    Here is the code I am currently using.
    var urlRequest:URLRequest = new URLRequest("images.xml");
    var urlLoader:URLLoader = new URLLoader();
    var myXML:XML = new XML();
    var xmlList:XMLList;
    urlLoader.load(urlRequest);
    myXML.ignoreWhitespace = true;
    urlLoader.addEventListener(Event.COMPLETE,fileLoaded);
    var arrayURL:Array = new Array();
    var arrayName:Array = new Array();
    var holderArray:Array = new Array();
    var nrColumns:uint = 1;
    var wheel:MovieClip;
    var holdMe;
    var thumbsprite:Sprite = new Sprite();
    addChild(thumbsprite);
    var thumb:Thumbnail;
    var thumbsHolder:Sprite = new Sprite();
    thumbsprite.addChild(thumbsHolder);
    function fileLoaded(event:Event):void {
         myXML = XML(event.target.data);
         xmlList = myXML.children();
         for (var i=0; i<xmlList.length(); i++) {
              var picURL:String = xmlList[i].url;
              var picName:String = xmlList[i].big_url;
              arrayURL.push(picURL);
              arrayName.push(picName);
              holderArray[i] = new Thumbnail(arrayURL[i],i,arrayName[i]);
              holdMe = holderArray[i];
              var loader:Loader = new Loader();
              loader.load(new URLRequest(xmlList[i].url));
              wheel=new rootz();
              holdMe.addChild(wheel);
              loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preload);
              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completed);
              function preload(event:ProgressEvent):void {
                   var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal * 100);
                   trace(String(percent) + "%");
              function completed(event:Event):void {
                   holdMe.removeChild(wheel);
              if (i<nrColumns) {
                   holderArray[i].y = 65;
                   holderArray[i].x = i*100;
              } else {
                   holderArray[i].y = holderArray[i-nrColumns].y+110;
                   holderArray[i].x = holderArray[i-nrColumns].x;
              thumbsHolder.addChild(holderArray[i]);

    I am not sure why but the code I posted did not post right,
    Here is my code -
    var urlRequest:URLRequest = new URLRequest("images.xml");
    var urlLoader:URLLoader = new URLLoader();
    var myXML:XML = new XML();
    var xmlList:XMLList;
    urlLoader.load(urlRequest);
    myXML.ignoreWhitespace = true;
    urlLoader.addEventListener(Event.COMPLETE,fileLoaded);
    var arrayURL:Array = new Array();
    var arrayName:Array = new Array();
    var holderArray:Array = new Array();
    var nrColumns:uint = 1;
    var wheel:MovieClip;
    var holdMe;
    var thumbsprite:Sprite = new Sprite();
    addChild(thumbsprite);
    var thumb:Thumbnail;
    var thumbsHolder:Sprite = new Sprite();
    thumbsprite.addChild(thumbsHolder);
    function fileLoaded(event:Event):void {
    myXML = XML(event.target.data);
    xmlList = myXML.children();
    for (var i=0; i<xmlList.length(); i++) {
    var picURL:String = xmlList[i].url;
    var picName:String = xmlList[i].big_url;
    arrayURL.push(picURL);
    arrayName.push(picName);
    holderArray[i] = new Thumbnail(arrayURL[i],i,arrayName[i]);
    holdMe = holderArray[i];
    var loader:Loader = new Loader();
    loader.load(new URLRequest(xmlList[i].url));
    wheel=new rootz();
    holdMe.addChild(wheel);
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preload);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completed);
    function preload(event:ProgressEvent):void {
    var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal * 100);
    trace(String(percent) + "%");
    function completed(event:Event):void {
    holdMe.removeChild(wheel);
    if (i<nrColumns) {
    holderArray[i].y = 65;
    holderArray[i].x = i*100;
    } else {
    holderArray[i].y = holderArray[i-nrColumns].y+110;
    holderArray[i].x = holderArray[i-nrColumns].x;
    thumbsHolder.addChild(holderArray[i]);

  • Pre-load a write-through cache

    This probably is a common problem.
    I want to use write-through cache to keep the cache and the db in sync. But at application start-up, I'd like to pre-load the cache. Is there anyway I can disable the write-through behavior during pre-loading, and enable it after pre-loading is complete?

    Wouldn't you just be better to load the data into the database first, and then just query it to get it into the cache? That way, the cache and the db are 'in sync', and no write operations have occurred; also, you don't need to 'flip' any cache settings. Subsequent updates to cache items would then be written to the database as normal.
    Surely if the data wasn't in the db first, you'd end up with a large 'write' operation to place it there once you've loaded the cache and 'flipped' it over, which could be quite a lengthy process. I can't see the advantage of this over putting the data in the db first?
    I'd be interested to know more about your specific use-case, as I'm just to embark on a similar 'loader' program. In my case, I was planning on loading the db first. I'd be interested in any alternative approaches and the reasoning behind them (or, likewise, if you can't actually do it the way I was planning! :)).
    Steve

  • The Notes app that comes pre loaded opens but shuts immediately

    the "NOTES" app that comes pre loaded opens but then shuts down immediately?

    Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing will be reset

  • Pre-loading conditional content(pictures etc.) before it needed.

    Hi, i have some linkedlist or tree-structure contents(images,sounds etc.) I want to pre-load next items(content) to cache while user interacting with current content. Thus, when user want to see next content, it'll show immideately and start loading next content in the background.
    For an example,
    Assume in image gallery in the tree structure. While user looking at the picture, i want to load next nodes of tree silently to improve speed.
    Is it possible to do that? Or Any of you have suggestions?

    Well of course i don't know exactly what the user will pick for next. But i know there are just couple of content he/she can choose from the tree structure.
    Assuming next node consist 5 pictures. I want to start loading all simultaniously, so no matter what user choose, so whatever user choose, that content has %x percentence loaded. I'm also quite sure about there'll max 5 content in the next nodes.
    For the future i'll collect data from user behaviour then i'll have possibility table to lookup and assign priorities for load.

Maybe you are looking for

  • The screen on my Ipod touch came away from the back.

    The screen on my ipod touch came away from the back and then stuck back down a couple of days later. The battery seems to be weak now but everything else is OK. What could have caused this? Over chargibg in the car cradle?, Heat? Being held too tight

  • Problem with traverse method

    Hi, I am having this problem: I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true. The problem is that when I press the left or rigth button it also

  • Electronic wallet

    Hello, is there any electronic wallet application for N95 available? I need it for storing PIN codes etc. Thanks.

  • How to retrieve my deleted icloud account

    I have Apple ID and I deleted my icloud account from my iphone, when am trying to add it again it doesn't recognised and as if it doesnt exist.

  • PSE 8 install question for Mac PowerBook G4, "Does not support PowerPC architecture CPU..."

    I am getting the following message during attempted install of Photoshop Elements 8 for my Mac PowerBook G4 (OS 10.4.11): "This product does not support PowerPC architecture CPU. Please upgrade or adjust your system to meet these requirements." I dou