Concurrent Access to Cache Mechanism

Below I have code from an object that is used for caching data from a database. My question deals with the method getCacheObj(). Does getCacheObj() return a copy of the reference to cacheObj or does it return the actual cacheObj variable itself?
Specifically I am concerned about a concurrency issue when the methods refreshCache() and getCacheObj() are called simultaneously. What would happen in the following situation:
Thread 1 calls findActiveByWebsiteArea() which calls getCacheObj(). getCacheObj() returns the cacheObj for processing down the line in a jsp or other java object. Prior to thread 1 finishing the processing with cacheObj, thread 2 calls refreshCache() which resets cacheObj. Is it possible for thread 2 to clash with thread 1?
public class NewsPeer extends AncestorCachePeer {
    // object that will house the cached data
    protected static NewsPeer cacheObj = null;
    // attributes for the instantiated cache object
    private Hashtable newsByWebsiteArea = null;
    private NewsPeer() {
        // private constructor to enforce a singleton
    public static void refreshCache() throws Exception {
        // reset the cache object so a fresh retrieve will be performed
        // the next time the cache is accessed
        synchronized (cacheObj) {
            cacheObj = null;
    private static NewsPeer getCacheObj() throws Exception {
        synchronized (cacheObj) {
            if (cacheObj == null) {
                cacheObj = new NewsPeer();
                cacheObj.retrieveCache();
            return cacheObj;
    public static List findActiveByWebsiteArea(String websiteareaId) throws Exception{
        // get item from cache obj
        return (List) getCacheObj().newsByWebsiteArea.get(websiteareaId);
    private void retrieveCache() throws Exception {
        // code to populate newsByWebsiteArea on cacheObj
}

I feel it's not a good idea to make your lock object null somewhere ...
for example, let us say refreshCache() method acquired the lock.
but before it performs CacheObj = null, it gets descheduled, and another thread, runs getCacheObj() and since it
cannot get the cacheObj, it waits on cacheObj's queue, and now the previous thread resumes, which makes cacheObj null.
It will be better if you can have a separate lockObject.
This is my suggestions and I may be wrong. So let us wait for the experts to give some more suggestions..

Similar Messages

  • JNDI as a caching mechanism

    Hi,
    We are building an application using stateless session beans to access some
    back end systems. The backend transaction is rather expensive with regards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans, storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects and storing
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performance of
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable of handling
    reasonable amounts of data there should be no reason to use the expensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of data that
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen

    Read-Only entity beans are the entity beans which never call ejbStore() and
    ejbLoad() is only called when timeout is expired (or never).
    If you want to cache data for the session only you can use HttpSession - in
    the cluster all requests are pinned to the server which originated the session
    until this server fails. To minimize replication overhead you can use transient
    fields or use the fact that replication happens only when session attribute is
    set() - you can associate a cache object with the session and lazy populate it
    later.
    Anders Mathisen <[email protected]> wrote:
    hi,
    thanks for the response, what do you mean by read-only entity beans ?
    Beans that are loaded with data manually (from eg. a stateless session
    bean), and just used as a dataholder ?
    I forgot to mention in the previous article that the caching mechanism here
    needs only be local to a single users session. That is a session will never
    use cached data from another session.
    Althoug even if we have the requirement above, some caching mechanism
    allowing for sharing of data could be handy here, this is not an absolute
    requirement.
    Anders M.
    Rob Woollen <[email protected]> skrev i
    meldingsnyheter:[email protected]...
    Stateful session beans should not normally be used as a cache. A
    stateful session bean instance is associated with a single user.
    I wouldn't use JNDI as a caching mechanism either.
    My suggestion would be Read-Only entity beans.
    -- Rob
    Anders Mathisen wrote:
    Hi,
    We are building an application using stateless session beans to access
    some
    back end systems. The backend transaction is rather expensive withregards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans,storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects andstoring
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performanceof
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable ofhandling
    reasonable amounts of data there should be no reason to use theexpensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of datathat
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com
    Dimitri

  • Unexpected error occurred :concurrent access to HashMap attempted

    While runnig the ALBPM 5.7 we got this error. This looks like the ALBPM workflow engine is using HashMap in a unsynchronized way. is this a known issue and is there a work around for this?
    This error happened shortly after a possible blip in the database server, with exception message which said:
    Message:
    The connectivity to the BEA AquaLogic™ BPM Server database has been successful restablished.
    Any thoughts/insight/past experience....
    Looks like we should be using Hashtable instead of a HashMap (or atleast a Synchronized HashMap)
    This is best done at creation time, to prevent accidental unsynchronized access to the map:
    Map m = Collections.synchronizedMap(new HashMap(...));
    See Exception message below
    Message:
    An unexpected error occurred while running an automatic item.
    Details: Connector [ffmaeng_ENGINE_DB_FUEGOLABS_ARG:SQL:Oracle (ALI)] caused an exception when getting a resource of type [0].
    Detail:Connector [ffmaeng_ENGINE_DB_FUEGOLABS_ARG:SQL:Oracle (ALI)] caused an exception when getting a resource of type [0].
    Caused by: concurrent access to HashMap attempted by Thread[ET(49),5,Execution Thread Pool]
    fuego.connector.ConnectorException: Connector [ffmaeng_ENGINE_DB_FUEGOLABS_ARG:SQL:Oracle (ALI)] caused an exception when getting a resource of type [0].
    Detail:Connector [ffmaeng_ENGINE_DB_FUEGOLABS_ARG:SQL:Oracle (ALI)] caused an exception when getting a resource of type [0].
    at fuego.connector.ConnectorException.exceptionOnGetResource(ConnectorException.java:95)
    at fuego.connector.ConnectorTransaction.getResource(ConnectorTransaction.java:285)
    at fuego.connector.JDBCHelper.getConnection(JDBCHelper.java:43)
    at fuego.server.service.EngineConnectorService.getConnection(EngineConnectorService.java:260)
    at fuego.server.service.EngineConnectorService.getEngineConnection(EngineConnectorService.java:160)
    at fuego.transaction.TransactionAction.getEngineHandle(TransactionAction.java:180)
    at fuego.server.execution.EngineExecutionContext.getEngineHandle(EngineExecutionContext.java:352)
    at fuego.server.execution.EngineExecutionContext.persistInstances(EngineExecutionContext.java:1656)
    at fuego.server.execution.EngineExecutionContext.persist(EngineExecutionContext.java:1010)
    at fuego.transaction.TransactionAction.beforeCompletion(TransactionAction.java:133)
    at fuego.connector.ConnectorTransaction.beforeCompletion(ConnectorTransaction.java:654)
    at fuego.connector.ConnectorTransaction.commit(ConnectorTransaction.java:330)
    at fuego.transaction.TransactionAction.commit(TransactionAction.java:303)
    at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
    at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:540)
    at fuego.transaction.TransactionAction.start(TransactionAction.java:213)
    at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:118)
    at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:58)
    at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
    at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:264)
    at fuego.server.execution.ToDoItem.run(ToDoItem.java:531)
    at fuego.component.ExecutionThread.processMessage(ExecutionThread.java:754)
    at fuego.component.ExecutionThread.processBatch(ExecutionThread.java:734)
    at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:140)
    at fuego.component.ExecutionThread.doProcessBatch(ExecutionThread.java:132)
    at fuego.fengine.ToDoQueueThread$PrincipalWrapper.processBatch(ToDoQueueThread.java:432)
    at fuego.component.ExecutionThread.work(ExecutionThread.java:818)
    at fuego.component.ExecutionThread.run(ExecutionThread.java:397)
    Caused by: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[ET(49),5,Execution Thread Pool]
    at java.util.HashMap.onExit(HashMap.java:226)
    at java.util.HashMap.transfer(HashMap.java:690)
    at java.util.HashMap.resize(HashMap.java:676)
    at java.util.HashMap.addEntry(HashMap.java:1049)
    at java.util.HashMap.put(HashMap.java:561)
    at fuego.lang.cache.CacheStatistic.lock(CacheStatistic.java:246)
    at fuego.lang.cache.TimedMultiValuatedCache.getLocked(TimedMultiValuatedCache.java:282)
    at fuego.lang.cache.TimedPool.get(TimedPool.java:80)
    at fuego.connector.impl.BaseJDBCPooledConnector.getConnection(BaseJDBCPooledConnector.java:140)
    at fuego.connector.impl.BaseJDBCConnector.getResource(BaseJDBCConnector.java:222)
    at fuego.connector.ConnectorTransaction.getResource(ConnectorTransaction.java:280)
    ... 26 more

    Hi BalusC,
    I forgot to tell one thing, the exception what I mentioned is coming very rarely. The application is in Production and they getting this Exception once in 3 months. Is there any way to re-produce the same exception number of times to check whether it has been fixed or not after installing the updates as you said. If you have any information regarding this exception please send me.
    Thank You.

  • Flex and concurrent access

    I am going to work on a new project. This project is a real time scanning  processing monitor. The application would launch from an html wrapper. Also a few more processes will also start from there using JavaScript code:
    oReadfromScanner1 = new ActiveXObject("comportreader.classname");
    oReadfromScanner2 = new ActiveXObject("comportreader.classname");
    I am going to have up to 10 scanner readers which will update Flex client screen.
    There will be many times when readers try to update the client in exact same time. What is a design pattern to manage simultaneous access to Flex? Or there will be no problem at all?
    Thanks

    Thanks for the feedback. This is still bothering me,
    yes I could have a static RandomAccessFile and
    synchronise on this, but I really want concurrent
    access.
    I've implemented a locking mechanism to prevent
    different RandomAccessFile instances updating the
    same record - is this not a waste if only one
    RandomAccessFile can write to the file anyway?
    Or is there another Java class I can use to access
    the file in this way?
    Thanks for the help.Hi,
    if the intention of using multiple instanced of RandamAccessFile is concurrent access, then i feel your locking mechanism doesnt achieve the purpose..
    also, at any case, you may not plan for full concurrency in updating a file....
    it is more prone to malfunctions..
    probably, to enhance performance, you can lock only the part your code that actually writes to the file, like io.write() , in this way you can perform all business logic with respect to writing and serialize only the actual file writing...
    even in this case, you must be sure that writing to different part of the file, doesnt really impact other parts of the file which might be manipulated by other threads..
    i have one more thought on this,
    if updating different parts of the file doesnt affect content of other parts of the file,
    then can you think of having different files itself?
    if using different files is not a good idea, then
    probably think of using some buffering mechanism, like collect all data concurrently and periodically update the actual file from the buffer.. just a raw idea but all depends on your system needs & requirements.. ..

  • Hi, I developed a web application using HTML5-Offline Application Cache mechanism. Inspite of deleting the cache as mentioned in the above steps, Firefox still maintains a copy of the page in it's cache. Also, a serious bug is, even though we delete all

    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    Hi,
    I developed a web application using HTML5-Offline Application Cache mechanism. Inspite of deleting the cache as mentioned in the above steps, Firefox still maintains a copy of the page in it's cache. Also, a serious bug is, even though we delete all temp files used by Firefox, and open the previously cached page, it displays it correctly, but upon refreshing/reloading it again shows the previous version of the page maintained in the cache.
    == Troubleshooting information
    ==
    HTML5: Application Caching
    .style1 {
    font-family: Consolas;
    font-size: small;
    text-align: left;
    margin-left: 80px;
    function onCacheChecking(e)
    printOutput("CHECKINGContents of the manifest are being checked.", 0);
    function onCacheCached(e) {
    printOutput("CACHEDAll the resources mentioned in the manifest have been downloaded", 0);
    function onCacheNoUpdate(e)
    printOutput("NOUPDATEManifest file has not been changed. No updates took place.", 0);
    function onCacheUpdateReady(e)
    printOutput("UPDATEREADYChanges have been made to manifest file, and were downloaded.", 0);
    function onCacheError(e) {
    printOutput("ERRORAn error occured while trying to process manifest file.", 0);
    function onCacheObselete(e)
    printOutput("OBSOLETEEither the manifest file has been deleted or renamed at the source", 0);
    function onCacheDownloading(e) {
    printOutput("DOWNLOADINGDownloading resources into local cache.", 0);
    function onCacheProgress(e) {
    printOutput("PROGRESSDownload in process.", 0);
    function printOutput(statusMessages, howToTell)
    * Outputs information about an event with its description
    * @param statusMessages The message string to be displayed that describes the event
    * @param howToTell Specifies if the output is to be written onto document(0) or alert(1) or both(2)
    try {
    if (howToTell == 2) {
    document.getElementById("stat").innerHTML += statusMessages;
    window.alert(statusMessages);
    else if (howToTell == 0) {
    document.getElementById("stat").innerHTML += statusMessages;
    else if (howToTell == 1) {
    window.alert(statusMessages);
    catch (IOExceptionOutput) {
    window.alert(IOExceptionOutput);
    function initiateCaching()
    var ONLY_DOC = 0;
    var ONLY_ALERT = 1;
    var BOTH_DOC_ALERT = 2;
    try
    if (window.applicationCache)
    var appcache = window.applicationCache;
    printOutput("BROWSER COMPATIBILITYSUCCESS!! AppCache works on this browser.", 0);
    appcache.addEventListener('checking', onCacheChecking, false);
    appcache.addEventListener('cached', onCacheCached, false);
    appcache.addEventListener('noupdate', onCacheNoUpdate, false);
    appcache.addEventListener('downloading', onCacheDownloading, false);
    appcache.addEventListener('progress', onCacheProgress, false);
    appcache.addEventListener('updateready', onCacheUpdateReady, false);
    appcache.addEventListener('error', onCacheError, false);
    appcache.addEventListener('obsolete', onCacheObselete, false);
    else
    document.getElementById("stat").innerHTML = "Failure! I cant work.";
    catch (UnknownError)
    window.alert('Internet Explorer does not support Application Caching yet.\nPlease run me on Safari or Firefox browsers\n\n');
    stat.innerHTML = "Failure! I cant work.";
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET4.0E)
    == Plugins installed
    ==
    *-Shockwave Flash 10.0 r45
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Google Update
    *4.0.50524.0
    *Office Live Update v1.4
    *NPWLPG
    *Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Npdsplay dll
    *DRM Store Netscape Plugin
    *DRM Netscape Network Object
    Thanks & Regards,
    Kandarpa Chandrasekhar Omkar
    Software Engineer
    Wipro Technologies
    Bangalore.
    [email protected]
    [email protected]

    We have had this issue many, many times before including on the latest 3.6 rev. It appears that when the applicationCache has an update triggered by a new manifest file, the browser may still use only its local network cache to check for updates to the files in the manifest, instead of forcing an HTTP request and revalidating both the browser cache and the applicationCache versions of the cached file (seems there is more than one). I have to assume this is a browser bug, as one should not have to frig with server Cache-Control headers and such to get this to work as expected (and even then it still doesn't sometimes).
    The only thing that seems to fix the problem is setting network.http.use-cache to false (default is true) in about:config . This helps my case because we only ever run offline (applicationCache driven) apps in the affected browser (our managed mobile apps platform), but it will otherwise slow down your browser experience considerably.

  • How to synchronize concurrent access to static data in ABAP Objects

    Hi,
    1) First of all I mwould like to know the scope of static (class-data) data of an ABAP Objects Class: If changing a static data variable is that change visible to all concurrent processes in the same Application Server?
    2) If that is the case. How can concurrent access to such data (that can be shared between many processes) be controlled. In C one could use semaphores and in Java Synchronized methods and the monitor concept. But what controls are available in ABAP for controlling concurrent access to in-memory data?
    Many thanks for your help!
    Regards,
    Christian

    Hello Christian
    Here is an example that shows that the static attributes of a class are not shared between two reports that are linked via SUBMIT statement.
    *& Report  ZUS_SDN_OO_STATIC_ATTRIBUTES
    REPORT  zus_sdn_oo_static_attributes.
    DATA:
      gt_list        TYPE STANDARD TABLE OF abaplist,
      go_static      TYPE REF TO zcl_sdn_static_attributes.
    <i>* CONSTRUCTOR method of class ZCL_SDN_STATIC_ATTRIBUTES:
    **METHOD constructor.
    *** define local data
    **  DATA:
    **    ld_msg    TYPE bapi_msg.
    **  ADD id_count TO md_count.
    **ENDMETHOD.
    * Static public attribute MD_COUNT (type i), initial value = 1</i>
    PARAMETERS:
      p_called(1)  TYPE c  DEFAULT ' ' NO-DISPLAY.
    START-OF-SELECTION.
    <b>* Initial state of static attribute:
    *    zcl_sdn_static_attributes=>md_count = 0</b>
      syst-index = 0.
      WRITE: / syst-index, '. object: static counter=',
               zcl_sdn_static_attributes=>md_count.
      DO 5 TIMES.
    <b>*   Every time sy-index is added to md_count</b>
        CREATE OBJECT go_static
          EXPORTING
            id_count = syst-index.
        WRITE: / syst-index, '. object: static counter=',
                 zcl_sdn_static_attributes=>md_count.
    <b>*   After the 3rd round we start the report again (via SUBMIT)
    *   and return the result via list memory.
    *   If the value of the static attribute is not reset we would
    *   start with initial value of md_count = 7 (1+1+2+3).</b>
        IF ( p_called = ' '  AND
             syst-index = 3 ).
          SUBMIT zus_sdn_oo_static_attributes EXPORTING LIST TO MEMORY
            WITH p_called = 'X'
          AND RETURN.
          CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
              listobject = gt_list
            EXCEPTIONS
              not_found  = 1
              OTHERS     = 2.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CALL FUNCTION 'DISPLAY_LIST'
    *       EXPORTING
    *         FULLSCREEN                  =
    *         CALLER_HANDLES_EVENTS       =
    *         STARTING_X                  = 10
    *         STARTING_Y                  = 10
    *         ENDING_X                    = 60
    *         ENDING_Y                    = 20
    *       IMPORTING
    *         USER_COMMAND                =
            TABLES
              listobject                  = gt_list
            EXCEPTIONS
              empty_list                  = 1
              OTHERS                      = 2.
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
      ENDDO.
    <b>* Result: in the 2nd run of the report (via SUBMIT) we get
    *         the same values for the static counter.</b>
    END-OF-SELECTION.
    Regards
      Uwe

  • How to build cache mechanism

    Hello all
    i have application that basically loading very big object that contains sub objects and
    doing dynamic lookup by name of the object and the method i like to invoke and then invoke it
    everything done ofcorce with reflection .
    now this application will be called handeret times per minute .
    some questions .
    first of all do i need caching mechanism? for saving the subobject that had bean called in some kind of vector in memory for example or if i use reflection , i dont need caching mechanism .
    second question is do i need threads here ? if i do , how i buid some kind of locks to this threads ?
    thanks

    I'd use the Flyweight pattern here. It sounds like you're retrieving a lot of data that's related to other data through some kind of index. A Data Transfer Object (DTO) is a Flyweight class that could hold all of the information required to retrieve the "sub-objects" as you call them, but not until they're needed. It's a little more detailed to make sure that the objects are available when you need them, but obviously the network bandwidth/latency issues are causing a severe performance impact. I'm using EJBs in this example, but it will apply to anything where large amounts of related data are used in the application.
    // EJB Entity bean
    public abstract class EJBEntity extends EJBObject {
        public abstract Integer getId();
        public abstract String getStringData();
        public abstract Collection getChildObjects(); // "heavyweight" data
    // Data Transfer Object
    public class EJBEntityDTO {
       private int id;
       private String stringData;
       private int[] childIds;
    // some application code
    id = ...
    EJBEntityDTO dto = transferEJBData(id);
    EJBEntityDTO childDTO = transferEJBData(dto.childIds[0]);
    ...It's definitely more work to do it this way, but it's the only way to avoid fetching the entire collection when you only need one child object.
    Brian

  • Access the cached session in ADF

    Hello,
    I have generated an EO A. Business logic is triggered to call a DB store procedure in EO A generated java class.
    The DB store procedure is to create list of record in A. The list of records are cached in the session and not committed yet.
    If i can access this cache, i can simply do select * from A where A.key = k to get the list of records.
    How can I do that in the entity object generated java class?
    Thanks

    Hello,
    I am using JDeveloper 11.1.1.3.0
    Actually, I want to convert a PL/SQL logic in the ADF BC.
    The original logic is using a calling a store procedure and then using a cursor to retrieve the record.
    So, when i called the same store procedure in ADF BC, how can I access the cached record in the same way as cursor?
    For example,
    A entity object/view object was created on DB table SCHED, a button is pressed to trigger the store procedure
    so that a list of schedule records of SCHED are generated but not committed.
    How can I access the generated record of SCHED?
    Thanks

  • What is the caching mechanism firefox 3.6 uses compared to what IE 6/7 and 8/9 use?

    I just need to know how firefox handles/takes care of/and does its work with cookies and cache, basically its caching mechanism. Also comparing it to IE versions 6/7 and 8/9 would help, for the sake of web development with respect to the two browsers (Detailed technical answer would help). Since web apps may sometimes work on firefox and sometimes not while it works in IE just fine.

    Hi Kellymarr,
    You can take a look at the release notes for each version to see what has been added or fixed:
    http://www.mozilla.org/en-US/firefox/4.0/releasenotes/
    Just change the version number in the url to see each major release.
    Hopefully this helps!

  • Concurrent access

    Hi all,
    I have created a BAPI which is working well.
    However, if I call it more than one times at the same times through RFC (php call), it doesn't work correctly.
    Can anyone help me about concurrent access like this ?
    Thanks,
    Smoltok

    Hello,
    Before the call to your BAPI, call the function module ENQUEUE_<name of the lock object> and pass the parameters to locjk the specific entry. Now all your BAPI amd once done unlock the entry by call the function module DEQUEUE_<name of the lock object>.
    Regards,
    Sachin

  • Suitable Caching Mechanism

    Apoplogies if this is the wrong newsgroup. My J2EE App runs on Weblogic 8.1 and uses Oracle 9. It involves processing at times up to 50000 database records at a go. The Application applies an algorithm to each database record and then writes it's results to an output table which has a one to one mapping with the input table i.e I will be inserting about 50000 records. In order to improve performance I want to use JDBC batch inserts, however each output record is produced by a MDB (Message Driven Bean) from a pool.I guess I need a sort of cacheing mechanism which holds the records from the MDBs and some business logic to apply the JDBC batch insert to a chunk of the cache. I will probably need a timed event to perform this "flushing" of the cache periodically. Anybody have experience of doing something similar or able to provide a more elegant solution to the problem?
    TIA

    Hi Sailendra,
    In this case you can make use of BPM object if I understood your question correctly.
    In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
    You can acccess those values in another process/activities by bpmobject.attributeName
    bpmobject is the object that you created and the instance variable is of type created bpmobject.
    attributeName is the attribute where you stored the value.
    Regards
    Bibhu

  • Concurrent access in Diadem

    How does Dia   dem manages concurrent access?
    If several network users each of them having a floating licence, want to access the same objects (datasets, reports, view layout), can they?
    What happens if they want to load/delete/modify datasets located in the same folder?
    And if they want to write on the same report?
    Thanks

    Hi condor31,
    The only thing which is concurrent is the license file.  The DIAdem installation is still local on the client computer, which means that client A's DIAdem is completely separate from client B's DIAdem, because the two DIAdems are running on completely different computers.  So you don't have to worry about collisions at the REPORT object level at all.  If DIAdem A and DIAdem B attempt to access or update the same external files (layout files, data files, etc.), then the usual file access rules apply.  Both DIAdem A and DIAdem B can load the same layout or data file from computer C, say, and play with them back on computers A and B, respectively.  If DIAdem A then overwrites the layout or data file on computer C with an updated version, DIAdem B doesn't notice, because DIAdem B has those files in memory on computer B.  If DIAdem B subsequently overwrites the layout or data file on computer C, then DIAdem B wins and its version of the file is now on computer C, though DIAdem A doesn't know this has happened.  If you want to protect a particular data or layout file, you can of course set its Windows read-write permissions to read-only, then neither DIAdem A nor DIAdem B will be able to change it, though they will be able to read it and use it and save the edited version to a new data or layout file.
    The one exception to this is if DIAdem A and DIAdem B happen to register-load the same data file, then they each have an implicit link back to the data file on computer C, and neither will be able to change that data file, since register-loading opens the data file read-only and puts a lock on it so that no one can change it while you have it open, but this is a special case.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How does the Concurrent Access License (CAL) work.

    Description from Google: How does the Concurrent Access License (CAL) work? Xcelsius Engage Server CALs allow for concurrent live data updates inside Xcelsius dashboards. Every time an end-user triggers a Web service inside an Xcelsius dashboard to retrieve live data, a CAL is consumed for a period of 5 minutes. For that period, in a five CAL deployment for example, there will be only four CALs left for consumption. A five CAL deployment could support up to 25 users and additional CALs can be added to support a larger deployment.
    My question is as follows:
    How a five CAL deployment could support up to 25 users and what does it mean. In the first line it is saying that each CAL for a web service is consumed for a period of 5 minutes and how come it can support 25 users concurrently. Did it mean 25 web service connections inside a swf flash file or 25 different users to access a single web service through swf flash.

    The "Set cost controls" concurrent program is used in R12 to mass update the cost control fields on item costs.
    The cost control region is found by going to Cost management >Item costs > Item Costs
    The concurrent program lets you specify which items /costs should be updated by using various parameters such as cost type, item range, category range etc.
    And you can specify the source for the new cost control data and the new value for the fields.
    Hope this answers your question,
    Sandeep Gandhi

  • LiveCycle unable to access Cache Controller. Exception message - Error accessing the cache container - Error on GET action for cache Replicated:UM_CLUSTER_INVALIDATION_CACHE

    The incident starts after all the members are removed from the DCS Stack DefaultCoreGroup view and added back again by WebSphere Application Server. Following exceptions are seen after LiveCycle was added back in again to the view.
    We have a clustered environment with two nodes 2A and 2B. Server 2A crashed and therefore all members on 2B node were removed from the DCS view. Later the new core group view was installed but LiveCycle did resume operations as expected.
    Errors below:
    Exception caught while dealing with cache : Action - Get, ObjectType - UM_CLUSTER_INVALIDATION_CACHE, Exception message - Error accessing the cache container - Error on GET action for cache Replicated:UM_CLUSTER_INVALIDATION_CACHE
    ServiceRegist W   Cache get failed for service EncryptionService Reason: Error accessing the cache container - Error on GET action for cache
    Error accessing the cache container - Error on GET action for cache Local:SERVICE_FACTORY_CACHE
    The following message appeared for several different services:
    Cache put failed for service [CredentialService, ReaderExtensionsService,EncryptionService, etc]
    SSOSessionCle W   Error in cleaning stale sessions from the database. These sessions would be deleted in next trigger
                                     java.lang.RuntimeException: com.adobe.livecycle.cache.CacheActionException: Error accessing the cache container - Error on ENTRYSET action for cache Local:UM_ASSERTION_CACHE
      at com.adobe.idp.um.businesslogic.authentication.AssertionCacheManager.removeExpiredResults( AssertionCacheManager.java:125)
      at com.adobe.idp.um.scheduler.SSOSessionCleanupJob.execute(SSOSessionCleanupJob.java:69)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
    Caused by: com.adobe.livecycle.cache.CacheActionException: Error accessing the cache container - Error on ENTRYSET action for cache Local:UM_ASSERTION_CACHE
      at com.adobe.livecycle.cache.adapter.GemfireLocalCacheAdapter.entrySet(GemfireLocalCacheAdap ter.java:219)
      at com.adobe.idp.um.businesslogic.authentication.AssertionCacheManager.removeExpiredResults( AssertionCacheManager.java:99)
      ... 3 more
    Caused by: com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException: GemFire on 2B<v1>:9057/51073 started at Sun Aug 17 08:57:23 EDT 2014: Message distribution has terminated, caused by com.gemstone.gemfire.ForcedDisconnectException: This member has been forced out of the distributed system.  Reason='this member is no longer in the view but is initiating connections'
      at com.gemstone.gemfire.distributed.internal.DistributionManager$Stopper.generateCancelledEx ception(DistributionManager.java:746)
      at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem$Stopper.generateCance lledException(InternalDistributedSystem.java:846)
      at com.gemstone.gemfire.internal.cache.GemFireCacheImpl$Stopper.generateCancelledException(G emFireCacheImpl.java:1090)
      at com.gemstone.gemfire.CancelCriterion.checkCancelInProgress(CancelCriterion.java:59)
      at com.gemstone.gemfire.internal.cache.LocalRegion.checkRegionDestroyed(LocalRegion.java:669 4)
      at com.gemstone.gemfire.internal.cache.LocalRegion.checkReadiness(LocalRegion.java:2587)
      at com.gemstone.gemfire.internal.cache.LocalRegion.entries(LocalRegion.java:1815)
      at com.gemstone.gemfire.internal.cache.LocalRegion.entrySet(LocalRegion.java:7941)
      at com.adobe.livecycle.cache.adapter.GemfireLocalCacheAdapter.entrySet(GemfireLocalCacheAdap ter.java:209)
      ... 4 more
    Caused by: com.gemstone.gemfire.ForcedDisconnectException: This member has been forced out of the distributed system.  Reason='this member is no longer in the view but is initiating connections'
      at com.gemstone.org.jgroups.protocols.pbcast.ParticipantGmsImpl.handleLeaveResponse(Particip antGmsImpl.java:106)
      at com.gemstone.org.jgroups.protocols.pbcast.GMS.up(GMS.java:1289)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.VIEW_SYNC.up(VIEW_SYNC.java:202)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:276)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.UNICAST.up(UNICAST.java:294)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:625)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:187)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:504)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.FD.up(FD.java:438)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.Discovery.up(Discovery.java:258)
      at com.gemstone.org.jgroups.stack.Protocol.passUp(Protocol.java:767)
      at com.gemstone.org.jgroups.protocols.TP.handleIncomingMessage(TP.java:1110)
      at com.gemstone.org.jgroups.protocols.TP.handleIncomingPacket(TP.java:1016)
      at com.gemstone.org.jgroups.protocols.TP.receive(TP.java:923)
      at com.gemstone.org.jgroups.protocols.UDP$UcastReceiver.run(UDP.java:1320)
      at java.lang.Thread.run(Thread.java:773)
    [22/08/14 0:28:10:237 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:29:10:252 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:30:10:268 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:31:10:283 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:32:10:298 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:33:10:313 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:34:10:328 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:35:10:343 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:36:10:358 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:37:10:373 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerException
    [22/08/14 0:38:10:389 EDT] 00000b4f WorkPolicyEva W   Exception thrown in background thread. Cause: java.lang.NullPointerExceptionor
    I have tried looking for the root cause about why LiveCycle was not able to resume normally, didn't find anything related.

    LiveCycle uses Gemfire as distributed cache for cluster members. If you are using TCP Locators (caching based on TCP instead of UDP), below are the possible situations which might lead to “ForcedDisconnectException” :
    - There is time difference between two nodes.
    - These is network connectivity issues.
    - The high CPU usage by the member crashed.
    -Wasil

  • Accessing a Cache From an Oracle CQL User-Defined Function

    According to the docs ...
    I am to use the following element to set the cache property in my bean...
    <wlevs:property name="cache" ref="cache-id"/>
    However, when I set it, the assembly does not validate.
    If I use <property>, I get a NullPointerException on each request when my processor runs.
    Using the same CQL code..
    Without the <property> tag, the call to the user-defined function works (but I don't have the cache attribute set obviously).
    Here is the excerpt from my assembly...
    <bean id="cacheFunction" class="ou.cep.function.CacheFunction">
    <property name="cache" ref="myCache"/>
    </bean>
    <!-- The default processor for OCEP 11.0.0.0 is CQL -->
    <wlevs:processor id="myProcessor">
    <wlevs:listener ref="CacheChannel"/>
    <wlevs:function ref="cacheFunction" function-name="isValidID" exec-method="isValidID">
    </wlevs:function>
    </wlevs:processor>
    To repeat, with the same CQL with the user-defined function call, if I remove the property element from the bean definition, I can call the function successfully (it just doesn't do what I need it to do). In this case, I am still using the ref=cacheFunction for the wlevs:function within the processor.
    What am I doing wrong?
    Edited by: fl0at on Oct 5, 2010 12:22 PM
    Edited by: fl0at on Oct 5, 2010 12:28 PM

    The case is solved, not sure I could explain why, but...
    This implementation of the user-defined function was a migration from an implementation using the same cache in the join. So, when I removed the cache reference in the source stream (where I am now executing a function that accesses the cache), the problem went away and everything is working.
    I can explain further if there are questions.
    If anyone has thoughts on this, please advise.
    As always, thanks for the help.

Maybe you are looking for