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?

Similar Messages

  • 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

  • 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 the next swf

    Guys,
    i gonna tell the situation from the very beginning:
    I'm doing a book, wich each chapter is separated by swf (chapter_1.swf, chapter_2.swf, etc).
    In the final of each swf, he calls the next by the command: _root.loadMovie("next.swf")
    (PS: i'm not using the MovieClip load method)
    The problem is; when the swf are uploaded on my server, and i click to load the next swf, my screen goes blank while he download it.
    All i want to do, is pre-load the next swf, while the user is reading the actual chapter, to avoid this blank screen time. Is it possible?
    I read something about getBytesLoaded/Total, but don't know how to execute it.
    Please explain it clear cuz i'm new with this. And thank you very much for the support!

    If you want to have information regarding the loading progress of a file then you need to use the MovieClipLoader class.
    If you search Google you should be able to find a tutorial using search terms like "AS2 MovieClipLoader tutorial"

  • How to pre-load Coherence Caches used within an OEP Application

    Hi OEP/Coherence guys,
    I'm currently developing an OEP application that was consuming database inputs in CQL queries.
    I've replaced database direct access by Coherence caches access. My Coherence Local caches use a cache loader to fetch rows (by key) when there is a cache miss. This is working well, and the caches get filled in during the execution of my OEP application.
    The problem is that if CQL queries are made on some attributes (not the key) of not-yet-cached data, the load method of my cache loader is not invoked and there is no result to my CQL query.
    I'm wondering how to pre-load my data in Coherence Caches, from the database, when the OEP application starts to avoid such kind of problems...
    Thx for any advice.
    Renato

    Hi.
    Could you please describe the way to "set-up a cache-loader to load data into your cache when the OEP application starts" ?
    I have a cache-loader configured with my cache. My cache-loader implements the "com.tangosol.net.cache.CacheLoader" interface.
    This interface only defines 2 methods:
    load(java.lang.Object oKey) ==> Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
    loadAll(java.util.Collection colKeys) ==> Return the values associated with each the specified keys in the passed collection.
    None of these methods allows me to pre-load my data (and BTW it looks like "loadAll" is never called by OEP)
    Thx
    RP

  • How can I pre-load the Flash on my page?

    I added Flash navigation to my HTML site. Whenever I click on
    a link, the Flash has to reload on every new page, so it takes a
    second longer to appear. Otherwise it works ok... this is just kind
    of annoying. Is there any way around this?

    load the HTML into an iframe.

  • 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

  • Pre loading

    My requirement is that I need data to survive a grid restart. I've implemented a write behind persistence layer, implementing CacheStore and IterableCacheLoader using an Oracle table to store objects. All appears to be working well. Rows are being inserted in the database in response to coherenced put()'s. But if I bounce the entire grid, I want coherence to become aware of the objects which are persisted in the store, by calling keys().
    Do I have to do this myself, using an external "cache warmer" process, or is there a way to induce Coherence to populate it's cache from the backing store on grid start up?
    I tried setting pre-load to true in the local-scheme in config xml file, but to no avail.
    I read a tantalizing description of custom quorum policy which claim to be able to do this. But there was no example and not enough detail for me.
    Leonard
    Edited by: 792513 on Sep 2, 2010 1:02 PM

    Hi Leonard,
    I think the following document should help you out.
    http://wiki.tangosol.com/display/COH35UG/Pre-Loading+the+Cache
    The cache store should also be aware that this is a preload so that it does not write the data back into the database.
    If you check out the section Sample Controllable CacheStore in the following document. It should help. Essentially there are two choices.
    Either use a control cache or use something like CacheStoreAware interface
    http://coherence.oracle.com/display/COH35UG/Sample+CacheStores
    Thanks,
    -Dave

  • Exception while loading data into the cache

    I'm getting the following error while attempting to pre-populate the cache:
    2010-11-01 16:27:21,766 ERROR [STDERR] (Logger@9229983 n/a) 2010-11-01 16:27:21.766/632.975 Oracle Coherence EE n/a <Error> (thread=DistributedCache, member=1): SynchronousListener cannot be added on the service thread:
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.addMapListener(PartitionedCache.CDB:14)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.addMapListener(PartitionedCache.CDB:1)
         at com.tangosol.coherence.component.util.SafeNamedCache.addMapListener(SafeNamedCache.CDB:27)
         at com.tangosol.net.cache.CachingMap.registerListener(CachingMap.java:1463)
         at com.tangosol.net.cache.CachingMap.ensureInvalidationStrategy(CachingMap.java:1579)
         at com.tangosol.net.cache.CachingMap.registerListener(CachingMap.java:1484)
         at com.tangosol.net.cache.CachingMap.get(CachingMap.java:487)
         at com.jpm.ibt.primegps.cachestore.AbstractGpsCacheStore.isEnabled(AbstractGpsCacheStore.java:54)
         at com.jpm.ibt.primegps.cachestore.AbstractGpsCacheStore.store(AbstractGpsCacheStore.java:83)
         at com.tangosol.net.cache.ReadWriteBackingMap$CacheStoreWrapper.store(ReadWriteBackingMap.java:4783)
         at com.tangosol.net.cache.ReadWriteBackingMap$CacheStoreWrapper.storeInternal(ReadWriteBackingMap.java:4468)
         at com.tangosol.net.cache.ReadWriteBackingMap.putInternal(ReadWriteBackingMap.java:1147)
         at com.tangosol.net.cache.ReadWriteBackingMap.put(ReadWriteBackingMap.java:853)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.put(PartitionedCache.CDB:98)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onPutAllRequest(PartitionedCache.CDB:41)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$PutAllRequest.onReceived(PartitionedCache.CDB:90)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    2010-11-01 16:27:21,829 ERROR [STDERR] (pool-14-thread-3) Exception in thread "pool-14-thread-3"
    2010-11-01 16:27:21,829 ERROR [STDERR] (Logger@9229983 n/a) 2010-11-01 16:27:21.766/632.975 Oracle Coherence EE n/a <Error> (thread=DistributedCache, member=1): Assertion failed: poll() is a blocking call and cannot be called on the Service thread
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.poll(Grid.CDB:5)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.poll(Grid.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.get(PartitionedCache.CDB:26)
         at com.tangosol.util.ConverterCollections$ConverterMap.get(ConverterCollections.java:1559)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.get(PartitionedCache.CDB:1)
         at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB:1)
         at com.tangosol.net.cache.CachingMap.get(CachingMap.java:491)
         at com.jpm.ibt.primegps.cachestore.AbstractGpsCacheStore.isEnabled(AbstractGpsCacheStore.java:54)
         at com.jpm.ibt.primegps.cachestore.AbstractGpsCacheStore.store(AbstractGpsCacheStore.java:83)
         at com.tangosol.net.cache.ReadWriteBackingMap$CacheStoreWrapper.store(ReadWriteBackingMap.java:4783)
         at com.tangosol.net.cache.ReadWriteBackingMap$CacheStoreWrapper.storeInternal(ReadWriteBackingMap.java:4468)
         at com.tangosol.net.cache.ReadWriteBackingMap.putInternal(ReadWriteBackingMap.java:1147)
         at com.tangosol.net.cache.ReadWriteBackingMap.put(ReadWriteBackingMap.java:853)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.put(PartitionedCache.CDB:98)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onPutAllRequest(PartitionedCache.CDB:41)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$PutAllRequest.onReceived(PartitionedCache.CDB:90)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    2010-11-01 16:27:21,922 ERROR [STDERR] (pool-14-thread-3) (Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2010-11-01 16:20:09.372, Address=169.65.134.90:7850, MachineId=28250, Location=site:EMEA.AD.JPMORGANCHASE.COM,machine:WLDNTEC6WM754J,process:5416) (Wrapped: Failed to store key="9046019") poll() is a blocking call and cannot be called on the Service thread) com.tangosol.util.AssertionException: poll() is a blocking call and cannot be called on the Service threadI'm a bit stumped as my code doesn't call poll() anywhere and this appears to be caused by the following in my CacheStore class:
    public void store(Object key, Object value) {
            log.info("CacheStore currently " + isEnabled());
            if (isEnabled()) {
                throw new UnsupportedOperationException("Store method not currently supported");
    public boolean isEnabled() {
            return ((Boolean) CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).get(ENABLED)).booleanValue();
        }the only thing I can think of is maybe it has a problem calling a cache from within a CacheStore (if that makes sense). What I have is a CONTROL_CACHE which just stores a boolean value to indicate whether the store(), storeAll(), erase(), and eraseAll() methods should do anything. Is this correct?

    Hi Jonathan,
    I am trying to implement a write-behind cache but my configs may be wrong. The config for the cache with the cachestore looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd" >
    <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>
              <near-scheme>
                   <scheme-name>party_cache</scheme-name>
                   <service-name>partyCacheService</service-name>
                   <!-- a sensible default ? -->
                   <thread-count>5</thread-count>
                   <front-scheme>
                        <local-scheme>
                        </local-scheme>
                   </front-scheme>
                   <back-scheme>
                        <distributed-scheme>
                             <backing-map-scheme>
                                  <read-write-backing-map-scheme>
                                       <internal-cache-scheme>
                                            <local-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>
                        </distributed-scheme>
                   </back-scheme>
                   <autostart>true</autostart>
              </near-scheme>
         </caching-schemes>
    </cache-config>and the control cache config looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd" >
    <cache-config>
         <caching-scheme-mapping>
         <cache-mapping>
              <cache-name>CONTROL_CACHE</cache-name>
              <scheme-name>control_cache</scheme-name>
         </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <near-scheme>
                   <scheme-name>control_cache</scheme-name>
                   <service-name>controlCacheService</service-name>
                   <!-- a sensible default ? -->
                   <thread-count>5</thread-count>
                   <front-scheme>
                        <local-scheme>
                             <high-units>100</high-units>
                        </local-scheme>
                   </front-scheme>
                   <back-scheme>
                        <distributed-scheme>
                             <backing-map-scheme>
                                  <read-write-backing-map-scheme>
                                  </read-write-backing-map-scheme>
                             </backing-map-scheme>
                        </distributed-scheme>
                   </back-scheme>
                   <autostart>true</autostart>
              </near-scheme>
         </caching-schemes>
    </cache-config>They have different service names but I'm guessing this isn't what you mean and I thought I was using write-behind but again I'm guessing my config is not correct?

  • 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

  • Vote on (option to pre-load JVM)

    Greetings.
    I wish to draw your attention to an RFE (request for enhancement) that could use your vote.
    The RFE is asking for the jre to have the option of preloading the JVM at startup. Once loaded, the new 'tray icon" service would be responsible for keeping the rt.jar library loaded (which basically means waking up every once in a while and executing something inside of rt.jar).
    This would be an option that is turned OFF by DEFAULT. The user would have to go into the java control panel to turn it on.
    Why do this you ask? Well I did some extensive testing on cold start times between 1.4, 1.5 and 1.6. See the link at the bottom. The upshot was, that a huge amount of time is spent loading the jvm and rt.jar. All of the lazy loading technologies really didn't help. So, for those willing to have YATI (yet another tray icon), please give the option of preloading the jvm. You see it with other products, like QuickTime...
    Please vote and leave your feeback at:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6346341
    The orginal thread that started it all (lots of benchmark data):
    http://forum.java.sun.com/thread.jspa?messageID=3962327

    You have good points. Perhaps it is my ignorance of windows internals - but let me take a stab at this and perhaps clear a couple of things up (for me at least).
    1) I think you are correct that the JRE footprint size is an issue especially when you compare it to something like quicktime. In defense of the RFE, it is precisely for that reason that I recommend that the option be off by default.
    2 and 3) The tray icon isn't the single JVM of the system. It is an instance of the JVM that is providing a service. Let me take a stab at how I would implement it.
    The java tray icon becomes a loading service that pre-caches the jar files in memory and cycles through them (to keep them in memory). When a local JVM instance is invoked, be it a browser or local application that instance of the jvm would query for the existance of the java tray service and if present, use it to load rt.jar etc. from its memory cache.
    Hope that makes sense.
    -Dennis
    Personally I think the idea of pre-loading the jvm
    like a tray icon would be a bad thing overall. I see
    your point however:
    1. First + Foremost java takes up too much memory.
    Just running simple hello world apps now take tens of
    megabytes to run simply because of the (bloated) size
    of the JRE. It's not like quicktime which can load a
    stub in < 1 Mb this is a bear
    2. What happens when someone calls System.exit()? I'm
    guessing your answer is "well the JVM restarts" but
    what about all the other apps running on that JVM? It
    would kill them too. Beyond that one java app(let)
    could start interfering with another java app taking
    memory making environment changes etc.
    3. Possibly my biggest best reason is that almost all
    real commercial java applications need more memory
    than the default allocated by just calling 'java ...'
    how would we know how much to allocate when starting
    the jvm? Or we could allocate at runtime and fragment
    memory all to ****. Anyway you get the idea

  • Cachestore for distributed scheme not getting invoked to "load" the entries

    Hi,
    We have a distributed scheme with CacheStore as below,
    SERVER PART
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>          
         <cache-mapping>
                   <cache-name>ReferenceData-Cache</cache-name>
                   <scheme-name>RefData_Distributed_Scheme</scheme-name>
         </cache-mapping>
         <!--
         FEW OTHER DISTRIBUTED CACHE
         -- >
    </caching-scheme-mapping>
    <caching-schemes>
    <!-- definition of other cache schemes including one proxy scheme -->
    <distributed-scheme>
         <scheme-name>RefData_Distributed_Scheme</scheme-name>
         <service-name>RefData_Distributed_Service</service-name>     
         <serializer>
         <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>                    
         <init-params>
              <init-param>
                   <param-type>string</param-type>
                   <param-value>TradeEngine-POF.xml</param-value>
              </init-param>
         </init-params>     
         </serializer>                         
         <backing-map-scheme>
         <read-write-backing-map-scheme>
         <internal-cache-scheme>
         <local-scheme>
         <expiry-delay>1m</expiry-delay>
         </local-scheme>
         </internal-cache-scheme>
         <cachestore-scheme>
         <class-scheme>
         <class-name>com.csfb.fid.gtb.referencedatacache.cachestore.RefDataCacheStore</class-name>     
         <init-params>
                        <init-param>
                             <param-type>string</param-type>
                             <param-value>{cache-name}</param-value>
                        </init-param>
                        </init-params>                    
         </class-scheme>
         </cachestore-scheme>
         <read-only>true</read-only>
         <refresh-ahead-factor>.5</refresh-ahead-factor>
         </read-write-backing-map-scheme>
         </backing-map-scheme>
         <backup-count>1</backup-count>
         <autostart system-property="tangosol.coherence.distributed-service.enabled">false</autostart>           
    </distributed-scheme>
    </caching-schemes>
    </cache-config>
    The above configuration is used on tcp extend proxy node with localstorage=false
    There is similar configuration on storage node,
    - with no proxy,
    - with same "ReferenceData-Cache" (autostart=true)
    - and localstorage=true.
    Following is my CacheStore implementation.
    NOTE: This Cachestore is only for loading the cache entry from cache store.i.e. from some excel file in my case, i.e. only load() and loadAll() methods.
    NO store() or storeAll().
    package com.csfb.fid.gtb.referencedatacache.cachestore;
    import java.util.Collection;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import com.creditsuisse.fid.gtb.common.FileLogger;
    import com.csfb.fid.gtb.referencedatacache.Currency;
    import com.csfb.fid.gtb.utils.refdada.DBDetails;
    import com.csfb.fid.gtb.utils.refdada.ReferenceDataReaderUtility;
    import com.tangosol.net.NamedCache;
    import com.tangosol.net.cache.CacheStore;
    public class RefDataCacheStore implements CacheStore
         private DBDetails dbDetails = null;
         private ReferenceDataReaderUtility utils = null;
    public RefDataCacheStore(String cacheName)
         System.out.println("RefDataCacheStore constructor..");
         //dbDetails = DBDetails.getInstance();
         utils = new ReferenceDataReaderUtility();
    public Object load(Object key)
         return utils.readCurrency(key);
    public void store(Object oKey, Object oValue)
    public void erase(Object oKey)
         public void eraseAll(Collection colKeys)
         public Map loadAll(Collection colKeys)
              System.out.println("RefDataCacheStore loadAll..");
              Map<String, Object> obejctMap = new HashMap<String, Object>();
              List<Object> list = utils.readAllCurrencies();
              Iterator<Object> listItr = list.iterator(colKeys);
              while(listItr.hasNext()){
                   Object obj = listItr.next();
                   if(obj != null){
                        String key = "CU-"+((Currency)obj).getId();
                        obejctMap.put(key, (Currency)obj);
              return obejctMap;
         public void storeAll(Map mapEntries)
    CLIENT PART
    I connect to this cache using extend client with follwing config file,
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                        <cache-name>ReferenceData-Cache</cache-name>
                        <scheme-name>coherence-remote-scheme</scheme-name>
              </cache-mapping>     
         </caching-scheme-mapping>
         <caching-schemes>
              <remote-cache-scheme>
                   <scheme-name>coherence-remote-scheme</scheme-name>
                   <initiator-config>
                        <serializer>
                             <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>                         
                             <init-params>
                                  <init-param>
                                       <param-type>string</param-type>
                                       <param-value>TradeEngine-POF.xml</param-value>
                                  </init-param>
                             </init-params>                         
                        </serializer>
                        <tcp-initiator>
                             <remote-addresses>                              
                                  <socket-address>
                                       <address>169.39.30.182</address>
                                       <port>9001</port>
                                  </socket-address>
                             </remote-addresses>
                        <connect-timeout>10s</connect-timeout>
                        </tcp-initiator>
                        <outgoing-message-handler>
                             <request-timeout>3000s</request-timeout>
                        </outgoing-message-handler>                                   
                   </initiator-config>
              </remote-cache-scheme>
         </caching-schemes>
    </cache-config>
    PROBLEM
    From my test case (with extend client file as configuration), when i try to connect to get cache handle of this cache, as
    refDataCache = CacheFactory.getCache("ReferenceData-Cache");
    I get following error on server side,
    2010-05-12 18:28:25.229/1687.847 Oracle Coherence GE 3.5.3/465 <Error> (thread=DistributedCache, member=2): BackingMapManager com.tangosol.net.DefaultConfigurableCacheFactory$Manager: failed to instantiate a cache: ReferenceData-Cache
    2010-05-12 18:28:25.229/1687.847 Oracle Coherence GE 3.5.3/465 <Error> (thread=DistributedCache, member=2):
    java.lang.IllegalArgumentException: No scheme for cache: "ReferenceData-Cache"
         at com.tangosol.net.DefaultConfigurableCacheFactory.findSchemeMapping(DefaultConfigurableCacheFactory.java:507)
         at com.tangosol.net.DefaultConfigurableCacheFactory$Manager.instantiateBackingMap(DefaultConfigurableCacheFactory.java:3486)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.instantiateResourceMap(DistributedCache.CDB:22)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.setCacheName(DistributedCache.CDB:27)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ConfigListener.entryInserted(DistributedCache.CDB:15)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
         at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
         at com.tangosol.util.ObservableHashMap.dispatchEvent(ObservableHashMap.java:229)
         at com.tangosol.util.ObservableHashMap$Entry.onAdd(ObservableHashMap.java:270)
         at com.tangosol.util.SafeHashMap.put(SafeHashMap.java:244)
         at com.tangosol.coherence.component.util.collections.WrapperMap.put(WrapperMap.CDB:1)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid$ServiceConfigMap.put(Grid.CDB:31)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$StorageIdRequest.onReceived(DistributedCache.CDB:45)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    However, with this error also i am able to do normal put operation and get operation against those put.
    But when i try to get the cache entry which doesnt exists in cache, like
    refDataCache.get("CU-1");
    I expected that call would go to RefDataCacheStore.load method. But in my case i dont see it happening.
    Also i debugged my jvms in debug mode and i put a class load breakpoint for RefDataCacheStore, but even that is not hit. I have RefDataCacheStore in my server classpath.
    Hope to see reply on this soon.
    Thanks
    Manish

    Hi Manish,
    <<previous advice deleted>>
    user13113666 wrote:
    Hi,
    I have my server picking up the correct configuration files for "ReferenceData-Cache". In my local jconsole i could see that the service named "RefData_Distributed_Service" is started under service mbean. Also i am able to perform a put and get on "ReferenceData-Cache", i could even see StorageManager mbean showing my inserted entries for "RefData_Distributed_Service".With the local jconsole, are you monitoring the server/proxy node, or the TCP*Extend cleint node?
    The client can have the service with the server still not having it.
    Could you please post the startup log for the storage node on the server...
    Best regards,
    Robert
    Edited by: robvarga on May 17, 2010 12:33 PM

  • Pre-load

    In other Servlet engines like JRun or ServletExec you can mark a Servlet
              so its pre-loaded - in other words the Servlet will be loaded into
              memory and the INIT() method called.
              I tried to Use the ServletStartup class to run the pre-load the NServlet.
              the following is the registration of the servlet in weblogic servlet
              properties file, I am using weblogic 5.1
              weblogic.httpd.register.NServlet=\
              examples.servlets.myservletclass
              # Configure the ServletStartup class to run NServlet's init()
              # method at startup
              weblogic.system.startupClass.StartMyServlet=\
              weblogic.servlet.utils.ServletStartup
              weblogic.system.startupArgs.StartMyServlet=\
              servlet=NServlet
              But it is giving the following message and it is not initializing the
              servlet prameters,
              Mon May 22 15:59:34 PDT 2000:<I> <WebLogicServer> Invoking T3StartupDef
              servletTest weblogic.servlet.utils.ServletStartup with {servlet=NServlet}
              Mon May 22 15:59:34 PDT 2000:<I> <WebLogicServer> T3StartupDef servletTest
              weblogic.servlet.utils.ServletStartup reports:servlet: NServlet not found
              I checked the classpath and it is perfect
              If I run the NServlet mannually then it is fine.
              any help will be great for me.
              thanks
              anil
              

              Please see the post from May 18 by Kumar in this same newsgroup.
              Thanks,
              Michael
              Michael Girdley
              Product Manager, WebLogic Server & Express
              BEA Systems Inc
              anil <[email protected]> wrote in message
              news:[email protected]...
              > In other Servlet engines like JRun or ServletExec you can mark a Servlet
              > so its pre-loaded - in other words the Servlet will be loaded into
              > memory and the INIT() method called.
              >
              > I tried to Use the ServletStartup class to run the pre-load the NServlet.
              > the following is the registration of the servlet in weblogic servlet
              > properties file, I am using weblogic 5.1
              >
              > weblogic.httpd.register.NServlet=\
              > examples.servlets.myservletclass
              > # Configure the ServletStartup class to run NServlet's init()
              > # method at startup
              > weblogic.system.startupClass.StartMyServlet=\
              > weblogic.servlet.utils.ServletStartup
              > weblogic.system.startupArgs.StartMyServlet=\
              > servlet=NServlet
              >
              >
              > But it is giving the following message and it is not initializing the
              > servlet prameters,
              >
              > Mon May 22 15:59:34 PDT 2000:<I> <WebLogicServer> Invoking T3StartupDef
              > servletTest weblogic.servlet.utils.ServletStartup with {servlet=NServlet}
              > Mon May 22 15:59:34 PDT 2000:<I> <WebLogicServer> T3StartupDef servletTest
              > weblogic.servlet.utils.ServletStartup reports:servlet: NServlet not found
              >
              > I checked the classpath and it is perfect
              > If I run the NServlet mannually then it is fine.
              >
              >
              > any help will be great for me.
              >
              > thanks
              > anil
              >
              >
              

  • QT movie will not pre-load text track for chapters when streaming

    We have been trying to stream quicktime files with chapters for some time and have followed every tutorial, message board advice and trick to get this to work but with no luck. I am unable to get the chapters to show up in QTplayer when the video is streaming. I am trying to accomplish exactly what you see on this web page http://media.law.unimelb.edu.au/kalt/
    Basically, we have successfully created our movie file (with fast start enabled), successfully created our text track, copied it onto our movie file, and set it to preload, as in the instructions at http://www.apple.com/quicktime/tutorials/chaptertracks.html (I had to roll-back QT Pro as the Preload checkbox has disappeared from 7.4.5!!).
    Then we have saved it as a self-contained movie, and it works perfectly, with drop-down chapters in the right places, etc.
    As soon as we put the file on our quicktime streaming server however, the file streams great but there are no chapters. If I look at the movie properties of our streaming file, there is no text track listed. The properties of the streaming file on the above web page DOES show the text track listed, so I am guessing that mine is simply not pre-loading the text file, even though I have checked the box to do just that and the chapters work great if I simply open the file locally, just not when it is streaming. I have tried this with many test files, large and small.
    Could anyone let me know how I can get that text track to pre-load in the stream and therefore have the chapters appear in the drop-down list in quicktime player when streaming? I would be eternally grateful!

    First, you don't have to roll-back QT Pro, as what you want to do can be accomplished with the latest QuickTime.
    Second, skip down to the bottom of that page you linked to. You'll find a Step 1 and Step 2 that applies to Streaming QuickTime movies with chapters. This was sort of confusing when I first tried it, but the way you accomplish Step 1 is to start the stream using a computer that has QuickTime Pro, then save the stream as "Self-Contained" (NOT the original movie that resides on your Streaming Server). As when you save any QuickTime stream as Self-Contained, you'll end up with a really tiny movie that simply points to the streaming server.
    Once you have that movie, you add the chapters to it (again, not to the movie that resides on your QTSS), then when someone clicks that link (or even if they download that tiny movie to their desktop), the chapter loads immediately (because it's right there) and choosing chapters in it commands the QTSS to begin playing from that point. I've got an example I posted here.
    http://www.keynoteuser.com/news/wp-content/uploads/2008/01/macworld2008.mov

Maybe you are looking for