How to make a global scope component to be thread safe?

One of my global component preserves states in its member variables, I am afraid that it's might messed up in multi-threading conditions, so how to make a nucleus global component to be thread safe?
Edited by: user13344577 on Jul 14, 2011 9:45 AM

Hi,
Just to help integrate Shaik's and my own seemingly contradictory replies:
If the member variables in your global component actually need to be globally available, so that multiple threads/sessions need to seem the same data, then you need to use synchronization or some scheme to make this data thread-safe when updating it. If the member variables are non-global data and are simply for convenience of having data available for multiple method calls or something like that, then you should do as I said (don't use synchronization) and use one of my suggestions to avoid this.
I have seen customers frequently do what I replied about and store non-global data in a global component, and Shaik simply interpreted what "user13344577" is trying to do differently. Clarification is needed to know which of our answers better applies.
Thanks.
Nick Glover
Oracle Support for ATG Products

Similar Messages

  • Resolving session scoped component in global scope component.

    Hi,
    I am implementing batch process and i am need to resolve session scoped component in global scoped component.
    In global scope component (one of the component referred by my scheduler which also in global scope as usual) and i need to resolve session scoped "/atg/epub/workflow/WorkflowView" component in my scheduler.
    I tried all possibilities but nothing worked out. I do not have access to current request, because its batch process. following ways i tried,
    1. getResolveName("/atg/epub/workflow/WorkflowView") method of GenericService which is extended by my global scope component -- This returns null.
    2. Tried to get the current request on ServletUtils to use resolveName() method on request.
    ServletUtlis.getCurrentRequest() - This returns null as expected.
    Is there any way to resolve session scoped component in global scope component. Thanks in advance.
    Edited by: 938890 on Jun 30, 2012 4:59 AM

    Try below :
    If you want to resolve the name of a Nucleus component from Java code that is not itself a Nucleus service, you must first initialize Nucleus with this construct:
    Nucleus.getGlobalNucleus().resolveName("target component")
    where target component is the name of the component you are looking up. Note that this construct works only for components with global scope.
    You can also resolve names of Nucleus components using the Java Naming and Directory Interface (JNDI). The following example shows how you can use JNDI to access the Scheduler component:
    String jndiName = "dynamo:/atg/dynamo/service/Scheduler";
    Context ctx = new javax.naming.InitialContext ();
    Scheduler s = (Scheduler) ctx.lookup (jndiName);
    reference - oracle ATG docs.
    ~ Praveer

  • How to make a global variabel

    I have a problem
    I wanna make global variable (not bind variable), and every page in portal can use this variable.
    Can anybody tell me how to make this var ?
    TIA

    I have used session variables to do what you are trying to do.
    Checkout http://technet.oracle.com/products/iportal/files/pdkjan/articles/primer.session.storage.html for a primer on session storage, and especially http://technet.oracle.com/products/iportal/files/pdkjan/plsql/doc/sdk20pkg.htm for how to use wwsto_api_session.
    Ken Atkins
    Computer Resource Team (www.crtinc.com)

  • BEX Query variant - how to make it Global ?

    We have a problem that we did not have in 3.x. In NW04s, when some one saves a query variant, it can be seen/accessed only by that person. We have a need to make it global so that other users in the division can use the variant to run the query. Does anybody know to make this work?
    I looked at the table RSRPARAMETRIZA and the field PERSONAL is always set to 'X' for variants created in BEX (using new BEX tool). We tried to blank this out (for testing) to see if the variant becomes global. But it did not help, in fact after this change whenever I choose this variant it kicks me out and I have to login again.
    Any input/workaround is appreciated.
    Regards
    -Bala

    As of NetWeaver 2004s variants (created in the BI70 runtime) are stored as an XML string inside of the table RSRPARAMETRIZA. In BW3.5 and before they were stored along with ABAP variants within the table VARI.
    Check these notes:
    1004479
    1003466
    990801
    981693
    973676
    978803
    973844
    774413
    Hope this helps,
    Prakash

  • How do you separate global data running in different threads of TestStand

    I have created a DLL which I want to call from multiple threads of TestStand. I also need to have some global data that is local to each thread. VC++ allows me to use the declaration:
    __declspec(thread) int foo
    to create "Thread Local Storage"
    (ie global data that is local in the each thread -- not shared between threads).
    This works fine from a VC++ application, but when I try to access data declared with this from Test Stand I get the following error.
    Win32error code 998 - Invalid access to memory location
    This occurs when I try to set a variable declared using this convention in my DllMain function.
    I get a -17502; System Level Exception when I access it from a function that I call in the DL
    L.

    Russell -
    I found the following comment in Microsoft's MSDN and I know that TestStand dynamically loads DLLs:
    If a DLL declares any nonlocal data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded withLoadLibrary, it causes system failure whenever the code references the nonlocal __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all of the DLLs that are statically linked. When you use LoadLibrary, there is no way to extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such as
    TlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • Portal WorkProtect mode: How to make a global enablement

    Hi Experts,
        Where can i make WorkProtect mode setting for all Portal Users in one go??

    Hi
    You can do it centrally as mentioned below
    There is a property known as workprotect.mode.personalize which can be set as ON or OFF. You can also set the value of the property - workprotect.mode.default, which affect the value globally.
    Check this for more details
    http://help.sap.com/saphelp_nw04/helpdata/en/37/50fb5066f9db43b3b5d5fc8de0c051/frameset.htm
    Regards,
    Praveen Gudapati

  • How to make a simple sound component

    Hi
    I'm creating component that takes this parameter:
    - Source: (the linkage name of the sound file imported into
    the library) Of Type String, and the variable name is V_Source.
    (the value is S1(Linkage name of the Sound)).
    - Button: (the button name that will play that sound) Of Type
    String, and the variable name is V_Button.
    (the value is B1(instance name of the Button)).
    and in the
    first frame of the component I put this code:
    var MySound = new S1();
    MovieClip(parent)["this.V_Button"].addEventListener(MouseEvent.CLICK,PlaySound);
    function PlaySound(event:MouseEvent) {
    MySound.play(0,0);
    1) I have this Bug:
    TypeError: Error #1010: A term is undefined and has no
    properties.
    at Untitled_fla::Symbol1_1/frame1()
    2) I want to remove the class S1() from the definistion and
    but the this.V_Source so that I can use it with any class name I
    put in the parameter of the component and not only for S1
    so the code
    will be something like this:
    var MySound = new this.V_Source
    MovieClip(parent)["this.V_Button"].addEventListener(MouseEvent.CLICK,PlaySound);
    function PlaySound(event:MouseEvent) {
    MySound.play(0,0);
    But I have this Bug:
    TypeError: Error #1007: Instantiation attempted on a
    non-constructor.
    at Untitled_fla::Symbol1_1/frame1()
    Note: I tried to change the Parameter Type in the component
    definition window for the (V_Source parameter) to Class but it
    keeps returning to String type I do not know why.
    can any body help me create this component.
    thanks.

    Use this:Toolkit.getDefaultToolkit().beep(); or this: System.out.print("\0007");
    System.out.flush();

  • Outlook 2010 - how to make "global address list" display larger?

    Does anyone know how to make the "global address list" box and text appear larger in Outlook 2010? 
    Thanks

    What do you mean? Can you please explain in detail?
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • Global Component - How is it thread safe?

    While a global component is serving many sessions and in turn many requests, how is the thread safety guaranteed? How the call stack is maintained?

    It's often possible to write a global component that is thread safe without using locks or synchronize. As long as the component's class member variables are set globally, e.g., via Nucleus configuration, and all thread-specific values are held in method variables (which are housed on the stack), the component is thread safe. If thread-specific values need to be accessed by multiple methods in the class, the values must be passed as formal method parameters rather than through class member variables. Most of the global components that ship in the ATG product stack follow this coding pattern and do not use any kind of locks.

  • MyArray is not responding as GLOBAL scope?

    Hello
    I want to have a Array declared in the form, and that Array should VISIBLE to every where of the form.
    Meaning, i can use tthat aray in every page, every subform, every text field to append the elements
    And to loop that array in some button (on click event).
    PLs. let me know how can i declare a array that is GLOBAL in scope, really global? at what level i hv to declare it? at root node level (say, my form name is VISITORinfio, so, keeping curson on this node and declaring array in readDoc event? )
    I tried with these options but not working at all!!

    Pls. help me that let me know how to declare a GLOBAL SCOPE array(i did by using var, with out var key word, i did at TOP level, even i dont hv any functions!) - Thank you

  • How to make audioclip sound once in a thread?

    in the thread, it sleep(100), so once I add the audioclip, it couldnot sound properly, and never stop.
    how to make the audioclip sould once in that thread?
    thank u so much!!!

    Jurjen Heeck wrote:saslove sap wrote:>
    > >
    > > >
    xinjiang li wrote:
    > > > Hi:
    > > >    How to reference  other's message in a thread when I wanna reply to him or her?Thanks in advance.
    > >

    > > Click the reply link with the message you want to quote, and then click the " (double quote) button/link in the editing screen.
    > >
    > > Jurjen
    >
    > Ha Ha for me also working !!...
    >
    > Regards
    > sas
    wow !!! it works

  • How to make a method global so that it can be used in another component.?

    Hi,
    Is it possible to make a method global so that it can be used in another component.?
    i.e I have one component C1 and methods declared in this component M1, M2, ...
    Now I have another component C2 and in this component i want to use method M1 of component C1.
    how to do so?
    Any inputs will be appreciated.
    Thanx.

    Hi,
    As Uday said, To make the method as global of component say C1, You have to make method as interface by clicking the check box.
    Now while using the method in other component say C2, you have to follow following steps:
    1. In used component of comp. C2, add component C1.
    2. Instantiate the component atleast once in any of the method of component using code wizard option:
    'Instantiate Used Componet'.
    3. Now you can call the method of component C1 using code wizard option 'Method call in used controller'

  • How to make Javascript access standard JSF component

    Hello all,
    I'm in need of a proper javascript code that access standard jsf component.
    Like we do for html tags;
    if( el.tagName.toLowerCase() != 'select')
    I need to do the same thing for a jsf tag i.e; <h:selectOneMenu>. How to make javascript access <h:selectOneMenu> like it does with <select> tag ? Please let me know asap. Extremely sorry if the question is kind of stupid....cause I'm a beginner for JSF environment.
    Any sort of help, suggestion or advice would highly be appreciated.
    Thanks in advance.

    Ummmm, I may be off the beaten path, but by the time your javascript is called the h:selectOneMenu would be a select tag within the dom. You should be able to reference that tag as you normally would.

  • How can I make a global change so all controls and indicators labels on the front panel change to another colour?

    How can I make a global change so all controls and indicators labels on the front panel change to another colour?
    I need to change the front panel so that it can be used in a dark environment.

    Hi
    The only way I see, is to use the "Controls[]" property and iterate through all of them. But don't forget about nested elements (i.e. clusters, tab-controls, ...).
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How to make the shortcut (accelerator) a ContextMenu to be global?

    how to make the shortcut (accelerator) a ContextMenu to be global to the Stage?

    OK, I'm going the applescript route. When I run the script within automator, it works fine. However, when I run the script from a menu as a service, it has no effect at all on iTunes. I must be missing something.
    Here's my script:
    tell application "iTunes"
              if player state is stopped then return
              try
                        set player position to (get player position) + (-5)
              end try
    end tell

Maybe you are looking for