Sharing object with READ_COMMITED?

Hi to all,
I'm working on my first project using EJB 3.0 and I'm facing some difficulties.
Long story short, I basically want to share an object across several (stateless and mdb) bean instances; the object is costly to build and for this reason I would like to just build it once and keep a single instance in memory (probably in the JNDI). The object is kind of like a tree, where read and updates can be performed.
What I would like is some sort of mechanism similar to READ_COMMITED for databases (reads at any time as long as there are no writes going on) to manage the concurrency access to the object.
I understand EJB's specs state that developers should not manage the synchronization of objects, especially resources. So, what's my best option in order to solve my problem?
I'm using JBoss 4.2.2, so I'm taking a look at JBoss Cache, but I'm definitely open to any other suggestion.
Regards

If you're asking whether there is a method to call from the object that will return a reference to the ServletContext, then there isn't one.
If the object contains business logic, then it should be independent of how the request came in. i.e. business objects should not be aware that they are running as part of a JSP/Servlet app. If other object references are needed, they should all be passed as arguments to the constructor or method. You could also create a "global" object that includes references to several other objects and pass the global object ref via an argument.
If your object is a JSP or servlet helper object that is designed to be aware of the environment, then it's ok to pass the ServletContext reference to a constructor or method.

Similar Messages

  • Can I call an object with synchronized methods from an EJB

    I have a need for multiple threads (e.g. Message Driven Beans) to access a shared object, lets say a singleton, I'm aware of the "you can't have a singleton in the EJB world" issues) for read/write operations, so the operations will need to be synchronised.
    I've seen various statements such as you can't use read/write static fields in EJBs and you can't use synchronisation primitives in EJBs but I've also seen statements that say its okay to access utility classes such as Vector (which has synchronised methods) from an EJB.
    Does anyone know if there is a definitive answer on this? What are the implications of accessing a shared object with synchronised methods from multiple EJBs? Is it just that the EJB's thread may block which limits the ability of the container to manage the EJBs? In the Vector example above (from Professional Java Server Programming) did they mean its okay to use these utility classes provided they aren't shared across threads?
    If I can't use a plain old Java Object does anyone know if there are other potential solutions for sharing objects across EJBs?
    In my problem, I have an operation that I want to run in a multi-threaded way. Each thread will add information to the shared object, and this info may be used by the other threads. There's no lengthy blocking as such other than the fact that only one thread can be adding/reading information from the shared object at a time.
    I've trawled through this forum looking for similar questions of which there seem to be many, but there doesn't seem to be any definitive answers (sorry if there was and I missed it).
    Thanks
    Martin

    You can share objects among EJB's or among objects used by one or more EJB's. You can use synchronization primitives - nothing will prevent you from doing that.
    After all, the container classes, JVM-provides classes, JDBC, JCA, JNDI and other such classes do all of this with impunity. You can too. You can use file and socket I/O as well, presuming you configure the security profile to allow it. Should you? Well it depends on what you need to accomplish and if there is another practical alternative.
    Yes the specification warns you not to, but you cannot be responsible for the interior hidden implementation of classes provided to you by the JVM or third parties so you can never truly know if your are breaking these written rules.
    But when you do these things, you are taking over some part of the role of the container. For short running methods that only block while another thread is using the method or code block and no I/O or use of other potentially blocking operations are contained in the method/block, you will be fine. If you don't watch out and create deadlocks, you will harm the container and its managed thread pool.
    You should not define EJB methods as synchronized.
    Also, if you share objects between EJB's, you need to realize that the container is free to isolate pools of your EJB in separate classloaders or JVM's. It's behavior can be influenced by your packaging choices (use of .ear, multiple separate .jar's, etc.) and the configuration of the server esp. use of clustering. This will cause duplicate sets of shared classes - so singletons will not necessarily be singleton across the entire server/cluster, but no single EJB instance will see more than one of them. You design needs to be tolerant of that fact in order to work correctly.
    This isn't the definitive answer you asked for - I'll leave that to the language/spec lawyers out there. But in my experience I have run across a number of occasions where I had to go outside of the written rules and ave yet to be burned for it.
    Chuck

  • Multiple shared objects

    There is an example app for FMS where people can move a ball which they share
    http://www.adobe.com/devnet/flashmediaserver/sample_apps.html
    I'd like to have this app extended so that:
    - each user has his own ball
    - The balls can be customized (e.g. color etc)
    I'd like to know what the best way is to create such an app. Would each user have his own shared object? Or would there be only one shared object with an array?
    Any help is appreciated how I should tackle this problem.
    thanks

    you would need each ball to have its own shared object thereby creating an onsync event for each shared object but i'd only have 1 onConnect event on the client side.

  • Shared objects linkage to binaries

    Hi -
    I included -lsunmath -lfsu -lompstubs as part of compile flags for the creation of a few fortran binaries. Now these library shared objects are part of /opt/SUNWspro/lib directory which is available on a development node. During compile and link it is ok as these shared objects are available locally on the compile node. However, when I move the binaries, thus created, to a runtime node and try to execute them they give a load error. The error is ld.so.1 ..libsunmath.so.1 not found. This, ofcourse, causes the binary to exit abnormally. How do I get around this problem. I cannot load these libraries on runtime environments. Is there any other way to compile and link with these shared objects with running into the above scenario? Your help will be appreciated very much.
    Regards

    You have some choices here:
    1. When you move the binaries, you can also make a copy
    of the libraries that it needs, and put them into an "install
    directory" with your binary. You can specify the directory
    where to find these libraries by using a link-time option
    when you create your binary.
    2. You can also try statically linking your program using
    linker options when you create your binary. This will embed
    the necessary code into your executable.
    Try a google search for "sun studio f90 static linking" or
    something like that, if you want take this path.

  • What is shared objects?

    Hi all,
       can you tell me what is shared objects and how it is used in abap objects, if possible explain with some examples.
    Thanks
    Sathish

    Hi Satish,
    <b>Shared Objects</b>
    Shared Objects are objects in the shared memory. Instances of classes and anonymous data objects can be stored. Named data objects can be stored as attributes of classes.
    <b>Shared Memory</b>
    The shared memory is a memory area on an application server, which is accessed by all of this server’s ABAP programs. Before shared objects were implemented, ABAP programs could access this memory area using the EXPORTand IMPORT statements exclusively with the SHARED BUFFER or SHARED MEMORY additions, and instances of classes or anonymous data objects existed exclusively in the internal session of an ABAP program.
    With the implementation of shared objects with Release 6.40, the shared memory was enhanced with the shared objects memory that stores shared objects. The size of the shared objects memory is determined by the abap/shared_objects_size_MB profile parameter.
    Shared objects are stored in what are called shared memory areas. You create and manage areas and their properties using Transaction SHMA .
    Now you got an idea of what shared objects are :
    Go to this link you will find screen shots and a smaple program here.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/900e3d9d-559e-2910-9dae-b132157a220f">shared_objects</a>
    Reward points if useful,
    Aleem.

  • Shared object symbols, ( I'm used to VC++ )

    Hi,
    I'm realy new at programming for linux in c++. But I'm not a noobe in C++. I'm used to MS VS.
    I tried to create shared objects with SunStudio12 and I'm was wandering if there is no "_declspec" for linux.
    The second thing is, it seams that nearly every class und function is exported. I opened the compiled so file with an editor an I saw symbols of all my classes and functions. Is there a way to reduce unwanted symbols?
    Thanks
    Martin

    ok, i understand. If I want to remove them I have to use an extra tool.
    But it make for me no sense, why are they still there. I exported ("__symbolic" ) online one funktion for all other functions an objects I set "-xldscope=hidden". Why are they still in there. Nobady can use these informations like
    9W&#65533;P        &#65533;=&#65533;]4&#65533;&#65533;;)&#65533;7       &#65533;NameSpace::Class1 &#65533;i&#65533;&#65533;T&#65533;&#65533;&#65533;&#1096;Ó^Th
           &#1311;)%&#65533;9&#65533;P"&#65533;k&#65533;&#65533;&#612;p       &#65533;&#65533;qL&#65533;<3&#65533;
    9W&#65533;P       NameSpace::Class2 const NameSpace::Class3<NameSpace::Class1>*  &#65533;&#65533;&#65533;
    &#65533;&#65533;&#65533;&#65533;&#65533;        &#65533;       &#65533;&#65533;&#65533;0O|CKA&#65533;^&#65533;+&#65533;*      NameSpace::Class3<NameSpace::Class1>*
         &#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;                &#65533;&#65533;&#65533;0O|CKA&#65533;^&#65533;+&#65533;*       &#65533;i&#65533;&#65533;T&#65533;&#65533;&#65533;&#1096;Ó^Th
           &#1311;)%&#65533;9&#65533;P"&#65533;k&#65533;&#65533;&#612;p       &#65533;&#65533;qL&#65533;<3&#65533;or should not be able to use it !
    Martin

  • A query with respect to creation of the  shared Objects.

    Hi ,
    I am having a query with respect to creation of the  shared Objects.
    I have seen a example where the Author is creatining Shared Object as shown
    below :
    SharedObj = null;
    sharedObj = SharedObject.getLocal("myTasks");
    and there is nothing related to the word "myTasks" anywhere in the Application .
    Can anybody please let me know what is this word "myTasks" mean here ??
    Thanks in advance .

    hi,
    With a shared object it will create one if it doesn't exist, so "myTasks" will become the shared object name or if it exists it will load any objects that are within that shared object.
    Below is a simple example that uses sharedobjects to store login details.
    http://gumbo.flashhub.net/login/
    David

  • Help with shared objects...again...

    Okay, I've been looking at a really good tutorial for shared objects in AS2, and I think I've gotten the basic concept down of how they work... now the problem lies in just integrating it into what I already have, which is making my brain hurt.  Basically its for a quiz game, which will have a dynamic scoreboard.  I want the scores in the shared object to update when the submit button is pressed, and then have the new values loaded into text boxes.  Displaying the values is going to be the easy part, its just updating them is what my brain doesnt want to wrap itself around.  Here is the array I have at the moment (yes, horribly inefficient, but the last time I actually did any coding before this was over 2 years ago when I was still a computer science major... with all of 4 actual Comp Sci courses under my belt -_-)
    scores= new Array();
    names= new Array();
    insert=function() {
         var newscore;
         var newname;
         newscore=0
         newscore=_global.correct;
         if (newscore > scores[0]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=scores[0];
             scores[0]=newscore;
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=names[0];
             names[0]=newname;
             else if (newscore > scores[1]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=newscore
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=newname;
    Continues all the way down to scores[14]
    Now, if I wanted this to pull data from the shared object, would I just put user_so.score[3]=user_so.score[2] for instance?  Or would I run the array and just update the new valued individually once the array insertion function completes?  THe problem with the latter is that it's not directly accessing the shared object so I'd need to find a way to pull them out into other variables first, and this is about the point where my brain just decides to short out on me and stop working alltogether...yay...
    So yea, any help on this would be much appreciated.
    also, would the array have to be declared within the shared object as well?  If so, how would I do that exactly?  Probably something so simple but the fact that it's shared objects is throwing me off...

    Ok, the shared object WAS working just fine until I had the banner start referencing it.  Then the quiz began giving me syntax errors like crazy, and even when the banner isnt runnit it gives me issues.
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);
    these are the lines it's telling me I need an on handler for, which I do have, at the very start of the entire code.
    Ive counted the brackets and those seem to line up, but I'll double check again.  The code is on the submit button itself (yes I know it's poor coding form, but this is how I learned it and what I'm used to, and since I'm on a bit of a time schedule now isn't the time to completely re-learn the proper conventions and etiquite of coding in flash).
    on (release) {
        if (user_so.data.tname!=undefined){
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            insert=function() {
        var newscore;
        var newname;
        newscore=0
        newscore=_global.correct;
        if (newscore > scores[0]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=scores[0];
            scores[0]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=names[0];
            names[0]=newname;
            else if (newscore > scores[1]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=newscore
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=newname;
        else if (newscore > scores[2]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=newname;
            else if (newscore > scores[3]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=newname;
            else if (newscore > scores[4]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=newname;
            else if (newscore > scores[5]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=newname;
            else if (newscore > scores[6]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=newname;
                else if (newscore > scores[7]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=newname;
                    else if (newscore > scores[8]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=newname;
                        else if (newscore > scores[9]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=newname;
                            else if (newscore > scores[10]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=newname;
                                else if (newscore > scores[11]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=newname;
                                    else if (newscore > scores[12]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=newname;
                                    else if (newscore > scores[13]) {
            scores[14]=scores[13];
            scores[13]=newscore;
            names[14]=names[13];
            names[13]=newname;
                                        else if (newscore > scores[14]) {
            scores[14]=newscore;
            names[14]=newname;
        else {
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            scores[0]=user_so.data.newscore;
            names[0]=user_so.data.tname;
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);

  • Problems with Shared Objects - WIERD (or i'm just plain o'l stupid)

    Using F8, AS2.0
    What I am trying to do is to store an array inside of a slot
    in a Local
    Shared Object.
    (snippet from function)
    // leaderboardShare is the Local Shared Object
    // the variable scores is passed through this function
    // if no array exists, create one
    if (this.leaderboardShare.data[this.userId] == null) {
    trace("{SharedLearning.setLeaderboardScore} no score data
    for this user
    exists, creating scores array");
    // create a new array to hold scores for this userId
    var myScores = new Array();
    myScores.push(score);
    this.leaderboardShare.data[this.userId] = myScores;
    // traces out the newly added score, (325)
    trace("{SharedLearning.setLeaderboardScore} scores in userId
    array: " +
    this.leaderboardShare.data[this.userId]);
    } else {
    trace("{SharedLearning.setLeaderboardScore} score data
    exists, adding
    current score to array ");
    // traces out existing data in userId slot (325)
    trace("{SharedLearning.setLeaderboardScore} scores in userId
    array: " +
    this.leaderboardShare.data[this.userId]);
    // traces out Number
    trace("score is type: " + typeof(score));
    // temp array to hold data from existing LSO scores
    var myScores:Array =
    this.leaderboardShare.data[this.userId];
    // traces 325
    trace("myScores (before): " + myScores);
    // temp variable to hold latest score passed through (dont'
    really need
    this)
    var newScore:Number = score;
    // add latest score to current score array
    myScores.push(newScore);
    // TRACES 325, NaN
    trace("myScores (after): " + myScores);
    // overwrite existing scores array in LSO with new set of
    scores
    this.leaderboardShare.data[this.userId] = myScores;
    I know I can do this with any other object, what gives? why
    would the LSO
    even care what i'm passing to it. Who cares that it's not a
    number, the
    array doesn't care what you stick into it.
    I'm truly confused.
    Any help will help me drink less tonight after i'm finished

    Nevermind....
    I found a block of code above it that was making it crap out.

  • Shared objects problem with translation

    Hello
    Here is my problem :
    - my default portal language is French, and I login in French.
    - I create a navpage in the "Shared objects" pagegroup. At Portal installation,
    this pagegroup is in English, and there's an available translation in French.
    - When i see my navPage being logged in French, the SmartLinks (Home, etc)
    always display in English while i expected them to by in French.
    - I don't have this problem in a "normal" pagegroup created in english and
    translated into French.
    regards
    A.

    I have a second problem with shared objects :
    So, i created that navpage and published it as a portlet to use it in pages but
    when it doesn't appear in the portlets lists. In what Submenu of the porlets
    navigator is it supposed to appear ? It is not in the "shared instances", and i
    can't see any other "shared" directory.

  • Issue with Shared Objects

    Hi all,
    I've a problem with a program working on Shared Objects technology.
    We have a Job, scheduled in 18 parallelism, and each one writes into the SHM controlled by a SHMA Class.
    At jobs ending, a program reads content from the area and sends an automatic e-mail with the results.
    Everything works well if the writer program is executed on-line.
    Otherwise, in background, seems that nothing is stored in the SHM.
    Here's the code executed by the writer program:
    FORM shared_memory_access  TABLES  it_fehler STRUCTURE rpfausg.
      DATA: errors_reference TYPE REF TO data.
      DATA: lx_pterl00       TYPE REF TO zcx_pterl00_collector.
      TRY.
    * --> Get SHM Access
          CALL METHOD zcl_pterl00_collector_root=>build
            EXPORTING
              invocation_mode = cl_shm_area=>invocation_mode_explicit.
    * --> It's ok?
          IF zcl_pterl00_collector_root=>area_exists EQ 'X'.
    * --> Fill Data:
            GET REFERENCE OF it_fehler[] INTO errors_reference.
            CALL METHOD zcl_pterl00_collector_root=>fill_area_with_data
              EXPORTING
                error_messages_dref = errors_reference.
          ENDIF.
        CATCH zcx_pterl00_collector INTO lx_pterl00.
          MESSAGE lx_pterl00 TYPE 'S' DISPLAY LIKE 'E'. "Non-blocking -> JOBS
      ENDTRY.
    ENDFORM.                    " SHARED_MEMORY_ACCESS
    Here is the section from the class handling the attachment to the SHMA:
    METHOD if_shm_build_instance~build.
      DATA: lx_collector TYPE REF TO zcx_pterl00_collector.
    * --> Automatic building of instance:
      TRY.
          CALL METHOD get_handle_for_update( inst_name ).
        CATCH zcx_pterl00_collector INTO lx_collector.
          MESSAGE lx_collector TYPE 'X'.
        CATCH: cx_shm_no_active_version.
          TRY.
              CALL METHOD get_handle_for_write( inst_name ).
            CATCH zcx_pterl00_collector INTO lx_collector.
              MESSAGE lx_collector TYPE 'X'.
          ENDTRY.
        CATCH: cx_shm_inconsistent.
          zcl_pterl00_collector=>free_area( ).
          TRY.
              CALL METHOD get_handle_for_write( inst_name ).
            CATCH zcx_pterl00_collector INTO lx_collector.
              MESSAGE lx_collector TYPE 'X'.
          ENDTRY.
      ENDTRY.
    ENDMETHOD.
    I cannot explain why multiple jobs do not populate the area...

    Hi Rob,
    if your requirement is to have many (18) active processes all updating the shared object, and very few simply reading the shared object, then versioning is probably not what you require.
    Versioning allows readers to continue to attach and read the active shared object instance while the updater gets their own instance of the shared object. When the updater does a detach_commit the old instance becomes obsolete and all new requests to attach will be diected to the new instance. The old instance will be cleaned up by garbage collection once all of its readers have detached.
    If your programs primarily attach for update then you will decrease performance with versioning because a new instance needs to be created at every attach for update.
    Perhaps you should just retry the attach for update after a small period of time has passed?
    If, on the other hand, you do have lots of other readers of the shared object you may well still find that it is more efficient not to have versioning. I build a web shop catalogue using shared objects and found that versioning severly hampered performance. This was because, once the catalogue was initialised, updaters were pretty rare but readers were constant.
    BTW make sure you keep the locks on the object as short as possible. Do all your preparation work first, then attach for update, update, detach as quick as possible.
    Cheers
    Graham Robbo

  • Device testing with Shared Objects are failing: Error #2130

    This is new for me. I've made a bunch of apps with Flash Pro CC and Air. After the last CC update I can't run my builds on an iPad. They hang as soon as I try to flush a shared object. Any ideas? Is there a new permission setting I need to define? Here is what the debugger says:
    Waiting for Player to connect...
    Error: Error #2130: Unable to flush SharedObject.
              at Error$/throwError()
              at flash.net::SharedObject/flush()
              at CleverClimbers_fla::MainTimeline/frame1()[MyFile_fla.MainTimeline::frame1:133]
              at CleverClimbers_fla::MainTimeline/frame1()
    Cannot display source code at this location.
    Debug session terminated.

    Hi,
    I am not able to reproduce the issue.
    I tried with the latest AIR 4.0 build on iPad version 7.0 and Flash Pro CC version 13.1.0.217.
    Could you please share the Flash Pro version you are using?
    Also if possible, please share the sample app as it would help us in investigating the issue.
    Thanks,
    Pranali

  • Problem with shared objects synchoronization.

    I encountered a small problem with shared objects.
    I'm working on a program that creates chat rooms of a fixed
    size of 30 users. When the 31th user comes, a new room is created.
    The idea is that the client first connects to the first room
    and checks if it's full by connecting to shared objects. If it is
    full, connection is closed and process is reapeated on a new
    instance of the application.
    I use a function to connect to an instance, which takes as a
    parameter a number (1 for instance room_1, 2 for room_2, etc). The
    function itself creates the necessary Netconnection and
    sharedObject objects.
    If a room is full, Netconnections and sharedObjects are
    closed and function is called again with another number.
    I have no problem for connecting to the first room, but after
    closing the first connection and connecting to the new room, there
    seem to be some problems with the shared objects (especially,
    OnSync doesn't seem to execute again after the connection to the
    shared objects of the new instance).
    I was wondering if you had any ideas what could cause this.
    Is it the use of the same variable names for connecting at two
    different shared objects?
    Here is the function :
    function initStreams(room) {
    client_nc = new NetConnection();
    client_nc.connect("rtmp://192.168.0.4/Elearning/room_"+room);
    in_ns = new NetStream(client_nc);
    in_ns2 = new NetStream(client_nc);
    Replay_video.attachVideo(in_ns);
    out_ns = new NetStream(client_nc);
    out_ns2 = new NetStream(client_nc);
    in_ns.play("my_recorded_stream");
    users_name = SharedObject.getRemote("users_name",
    _root.client_nc.uri, false);
    users_name.connect(_root.client_nc);
    users_language = SharedObject.getRemote("users_language",
    _root.client_nc.uri, false);
    users_language.connect(_root.client_nc);
    users_picture = SharedObject.getRemote("users_picture",
    _root.client_nc.uri, false);
    users_picture.connect(_root.client_nc);
    users_finger = SharedObject.getRemote("users_finger",
    _root.client_nc.uri, false);
    users_finger.connect(_root.client_nc);
    I you need more info, I can post more of the code on the
    forum.
    Any help would be really appreciated

    I don't see any onStatus events in the code you posted above.
    If you're defining the onstatus event outside the function, that's
    the problem. When you define the shared object, you also need to
    define it's onStatus event handler.
    Also, you really should wait for the onStatus event of the
    netConnection before you connect your sharedObjects. If you try to
    connect the SO before the netConnection is established, the SO will
    never connect.

  • Shared Object --does ADC recognize it at all with any profile?

    [URL]http://www.mediafire.com/?uytnzzyn4md[/URL]
    I made this little sample file to get a handle on SharedObjects.  Got it functioning just fine in Flash Player 10.  (AS 2.0)
    But I tried to make it work in the emulator, and couldn't get any phone that supports SharedObjects to read the data back into Flash once it's written out.
    I tried Nokia 6290,6600,7210, and others that have a device profile that shows support for the shared object.
    But none of them read data back off the disk.
    Has anybody been able to make the shared object work in the emulator?
    :<)McFrisco

    Thanks for the heads up.  I actually found this yesterday, but not by searching within Adobe, which gave me nothing.  I went to Google and tried a couple of search strings and in short order came up with this very tutorial!  Adobe should take lessons from google, or yahoo, or just about anybody, on how to enable people to drill down into their huge mountain of experience and data.
    Now, on to making this work in my project.  It works in the example, so, I have high hopes...
    :<)McFrisco

  • Sharing same entity object with multiple viewobject problem.

    Dear All,
    I have a common entity entity object, that i am using in 4 different vo(only the where clause is different),
    I have created 4 af:table from corrosponding vos, when i am inserting some records in any of the vo then all the vo is showing the same records.. even through each vo is having separate where clause,
    But when i do this with separate eo for each vo then it works fine..
    Here i just want to do with the single eo being shared by different vo of same kind.. except where clause, Also i want to know why this issue is comming on insert? is it normal expected behaviour ? If yes then how to overcome this problem..? Pls provide any good suggestions if you have..
    Thanks & Regards.
    Santosh.

    Hi Sacha,
    Thanks.. i read it and found following
    You can globally disable this feature by setting the jbo.viewlink.consistent to the value false in your configuration. Conversely, you could globally enable this >feature by setting jbo.viewlink.consistent to the value true, but Oracle does not recommend doing this. Doing so would force view link consistency to be set >on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well.Now i am thinking to set it false.. but as doc says but Oracle does not recommend doing this. Doing so would force view link consistency to be set on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well,
    With what option should i go...?
    go with separate eo and vo..?
    Regards,
    Santosh.

Maybe you are looking for