Confusion about shared objects...

Hi...
I'm building an application using JSP/Servlet technology and I've ecountered some behavior that is not that unexpected, but is something I can't seem to figure out how to get around.
I've been using two reference manuals over the last year, to learn JSP/Servlet development and I'm not sure that either one of them, do a very good job of explaining how to avoid the problem I'm seeing. (Or maybe they do, but I'm just too dense to figure it out.)
Both are O'Reilly manuals:
Java Servlet Programming - Jason Humber with William Crawford
Java Server Pages - Hans Bergsten
Anyway, I've tried to model my application using a MVC approach.
My controller servlet UserCtl.java is small and routes requests as a controller should.
My business logic is in a bean. UserBean.java This object has properties that represent the fields from my UserMaster table and corresponding setter/gettter methods. It also has methods to retrieve an individual user record, insert a record, update a record, delete a record and retrieve a list of records.
The scenario I'm experiencing is as follows:
I bring up my application in the browser on two different PC's.
I display the user list on each PC.
Now...
On each PC, I simultaneously click the Update User, selecting user 1 on pc 1 and user 2 on pc 2.
My application then, creates a record in a lock file, for each user record. This seems to work properly, even during the simultaneous click.
However...
When the update form is subseqently displayed, I have a situation where the form on each of the 2 pc's contains the same data.
I can verify that 2 different lock records were created, indicating that I did not click the same user by accident, however, the data in the form is clearly for only one of the users.
I've read the sections over and over and I feel like I understand their comments on concurrency and how the condition I'm seeing could occur, however, I've tried many things to overcome this and nothing seems to work.
Originally, I opened my JDBC database connection at the servlet level. I've subsequently tried doing it when I create the bean in the controller and subsequent to that, creating the connection object within the method that retrieves the user data inside the bean.
I've tried moving all my code into functions, so that any bean variables would be localized.
I've creating a bean from the JSP session bean object and then retrieving the record, and putting the bean back into the session object before moving to the update page.
Note... I've also enclosed my record retrieval code within a synchronize block.
I'm at a complete loss here. Nothing I do seems to work and I can consistently recreate this condition. Obviously, I can't move forward until I find out how to do this properly.
I'm disappointed in the Java Server Pages book, because the author encapsulated/wrapped all of his database i/o into his own database management routines.
This is a terrible practice for an author to perform. I understand the concept of why you would do that, however, it complicates learning the fundamentals first. I say show us how to do it the long way first, then show us how to improve on the implementation. Don't confuse an already complicated process with your own home-grown methodology.
Anyway... I digress. Can anybody give me any pointers or recommend a good book or web based example, that can show me how to overcome the issue I am encountering? My implementation is a straightforward, simple, approach. I am trying to grasp how this stuff works, without adding in all the extra stuff like tag libraries and XSLT, etc.
I just need to understand how to write a simple thread-safe application. I'll tackle the other stuff later. Oh... by the way... I have built the simple samples that overcome servlet class level counters that show the result differences between global variables at the servlet instance level versus reporting back localized variable values. I think that JDBC database access and/or bean creation, is more complex than that and that's where my problem is.
Any comments, pointers, references to simple samples, will be greatly appreciated.
Thanks,
Brett

          You do not need a shared files system - that is just for
          convenience. You do need to have identical directory stuctures
          for all instances in the cluster.
          Mike.
          "Tomato Bug" <[email protected]> wrote:
          >
          >hi all,
          > I have a confusion with shared objects in cluster.
          > A cluster needs a shared file system to store
          > configuration
          >files and shared objects. Can I only put the shared things
          >in the
          >shared file system but not put them on the servers in
          >the cluster.
          > Thanks.
          >
          > Tomato.
          

Similar Messages

  • Doco about Shared Objects.

    Hi, ABAPers.
    I'm trying to do my deadly best in ABAP Objects, so I'm try to understand the concepts concerning to Shared Objects.
    Is there any public document (such as manuals) where I can find documentation about this topic (definitions, usage, and so on)?
    I'll regard best answers,
    Cheers

    Hello Santiago
    I forget to mention a tutorial, also written by Thomas Jung, which covers the topic Shared Memory as well.
    ABAP Delta Training 6.40
    Regards
      Uwe

  • Confused about sharing music between two ipods

    I have a 30GB ipod video, and I bought my husband an 8GB nano for Christmas. I have been searching the threads trying to figure out how we can share music, but I seem to get conflicting information. I understand how to create separate libraries and I think I understand how to allow him access to my library (move itunes music folder into public folder?) but am still unclear about sharing music between ipods. Because in some of the posts, I have read that while you can share music and listen to it via multiple itunes libraries, you can ONLY listen to it on the computer--you cannot get it onto another ipod due to anti-piracy measures.
    I know I could create a playlist for him in my library, but I like to autosync my ipod and I don't really want his music on mine, because the songs we BOTH like I've already imported into my itunes library. I was hoping to set up a separate library for him, import my music files into it, then let him delete the artists he's not interested in and add the music he wants that I don't. But I don't want to go through all that if he won't be able to play the shared songs on his own ipod.
    I hope all this makes sense. Can someone who shares songs in this way give me some advice? Again, I would like for us to maintain separate libraries but I would like to make mine available to him so he doesn't have to reimport all the CDs I've already imported (and I don't want to waste computer space by having multiple copies of the same songs).
    Any help would be appreciated!

    I know I could create a playlist for him in my library, but I like to autosync my ipod and I don't really want his music on mine, because the songs we BOTH like I've already imported into my itunes library.
    Ver easy to accomplish.
    I have one library, two 4GB iPods and ~20GB of music.
    Rather than duplicating libraries or creating separate user accounts/sharing music you can't load, etc. which simply takes up space on the disk drive, use the same library and use sync only what you want.
    Create playlist(s) of your own music from the library.
    Add/remove from those playlists as you want.
    Connect your iPod, select it in iTunes and select the Music tab.
    Select Sync music, Sync selected playlists and choose what you want.
    The way I do it is I create a main playlist (Chris's Music) of music in the library that I like.
    I also create a smart playlist (Not Chris's Music) and set it to Match Rule - Playlist is not Chris's Music.
    This helps to manage my music by showing all music not in main playlist so I can browse for music I may have missed or now want to add.
    I do the same for my daughters iPod except she gets to pick her own stuff.
    This way whenever any music is added by either of us, it is available to the other with no problems.

  • Confusion about how object interact and are aware of each other

    I have this java applet
    Two of the classes it contains are the main class with the init method and a UI class that is code for the interface.
    the main class instantiates the UI class anonymously (i think you call it that) i.e it does not put it into a named reference it just creates it by calling new without assigning it to anything.
    When I click on a button from the UI class I want to call a method in the main class...but how so?
    At first I tried to make the function i want to call in the main class static so I could easily call it from the UI class...but then it began to get complex...so i just sent a reference of the main class to the UI class via its constructer.
    Now i want the main class to update a JTable in the UI class, but how? It does not have any reference to the UI class.
    What is really the standard method of operation for this sort of thing when objects have to be calling methods of each other. How do I make them aware of each other.

    the best way to do it is like this:
    public class Main {
      //this is the main class
      private static class MyUIFrame extends JFrame {
        //create the class. It is useable within Main this way
        //static means it doesn't implicitly 'know' about the Main class. You can also
        //remove this and call Main.this to use Main's methods
    }Edited by: tjacobs01 on Apr 11, 2009 2:28 AM

  • Confused about deleting objects

    I'm completely new to ActionScript, and I'm having trouble
    understand how to delete objects.
    If I make a new object, for instance "var shape:Shape = new
    Shape();", and later I try to delete that object ("delete(shape)"),
    it spits an error, telling me "Attempt to delete fixed the property
    drip". This seems to go for every object.
    What's the correct to delete an object? Within the object
    itself, I tried "delete(this)", which doesn't throw an error, but
    doesn't seem to work, either.

    I still don't quite understand. If I understand correctly, I
    don't delete objects, I just leave them alone, right? Except this
    doesn't seem to be the case.
    In my main AS, I have the following code:
    public function RainTower() {
    var rainTimer:Timer = new Timer(10);
    rainTimer.addEventListener(TimerEvent.TIMER, DripDrop,
    false, 0, true);
    rainTimer.start();
    private function DripDrop(event:TimerEvent):void {
    var drip:Raindrop = new Raindrop();
    addChild(drip);
    In a separate file, I have this:
    public function Raindrop() {
    trace("New drop");
    shape.graphics.lineStyle(0, 0x0000FF, 1);
    var offset:Number = 0;
    shape.graphics.drawRect(mouseX+offset, mouseY+offset, 3, 3);
    addChild(shape);
    updateTimer.addEventListener(TimerEvent.TIMER, Update,
    false, 0, true);
    updateTimer.start();
    public function Update(event:TimerEvent):void {
    shape.x += 1;
    shape.y += 10+_speedY;
    shape.alpha -= 0.05;
    if(shape.alpha < 0) {
    updateTimer.removeEventListener(TimerEvent.TIMER, Update);
    updateTimer.stop();
    It works like you'd expect, except that no matter what you
    do, things start bogging down after half a minute. How am I
    supposed to deal with the Raindrop instances that I no longer need?
    Obviously they're still having a residual effect on things.

  • About Order object in ATG

    Hi,
    I have some confusions about Order object in ATG. Please see -
    When actually ATG creates an Order object and how?
    Is there any scenario where we should use synchronize on Order object?
    An ItemPricingEngine invoked through a price droplet. How/when an OrderPricingEngine gets invoked?
    Thanks.

    Hi,
    Don't get confused that we need to synchronize only those things which are shared between multiple users.
    We should synchronize order because there should not be more than one thread/process updating it , else you will get inconsistencies and invalid version exceptions as already pointed by gurvinder.
    About your 3rd point :
    pricing can be invoked in many ways from many places , like droplet , formhandlers , pipelines etc.
    Enable loggingdebug on important components like OrderPricingEngine , ItemPricingEngine , Pricing tools and various Pricing calculators and study the logs  then you will be clear on what is invoked and when is invoked.

  • Followed the download and install for firefox into my linux home directory. When launching firefox got an error message about a mission shared object. Additional detail to follow.

    When launching firefox got the following error: XPCOMGlueLoad error for file ~/firefox/libxpcom.so libxul.so cannot open shared object file: No such file or directory Couldn't load XPCOM (but file libxul.so is there) what do I do???

    Make sure that you meet the system requirements and have all required libraries installed.
    *http://www.mozilla.com/en-US/firefox/8.0.1/releasenotes/
    *http://www.mozilla.com/en-US/firefox/3.6.24/releasenotes/
    *http://kb.mozillazine.org/Installing_Firefox#Linux
    You can find the latest Firefox releases here:
    *Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
    *Firefox 3.6.x: http://www.mozilla.com/en-US/firefox/all-older.html

  • About profiling a Shared Object

    Hi, I need to profile a shared object compiled with Gcc/G++ 3.2.
    I have sources for this shared object and can recompile it, but this DLL is executed by an executable of which i don't have sources and most of all I can't recompile it.
    How can I successfully profile my SO?
    I'm using on a "SunOS mxgf 5.8 Generic_117350-12 sun4us sparc FJSV,GPUZC-M" machine.
    Thanks,
    Ema.
    Message was edited by:
    Ema

    The Sun Studio performance tools support profiling gcc/g++
    compiled code. You don't need to have the a.out compiled for
    profiling. It will only affect whether or not you can see source-level
    data for the a.out, not what you can see for methods in the
    shared object. You must use the native libc.so, however.
    I would recommend the latest FCS of the Studio tools, Sun Studio 11.
    You will need to install patch 01, which is available now, or patch 02
    which will be released very soon, since there's a bug relating
    to demangling in the FCS version.
    Marty

  • Exception handling is not working in GCC compile shared object

    Hello,
    I am facing very strange issue on Solaris x86_64 platform with C++ code compiled usging gcc.3.4.3.
    I have compiled shared object that load into web server process space while initialization. Whenever any exception generate in code base, it is not being caught by exception handler. Even though exception handlers are there. Same code is working fine since long time but on Solaris x86, Sparc arch, Linux platform
    With Dbx, I am getting following stack trace.
    Stack trace is
    dbx: internal error: reference through NULL pointer at line 973 in file symbol.cc
    [1] 0x11335(0x1, 0x1, 0x474e5543432b2b00, 0x59cb60, 0xfffffd7fffdff2b0, 0x11335), at 0x11335
    ---- hidden frames, use 'where -h' to see them all ----
    =>[4] __cxa_throw(obj = (nil), tinfo = (nil), dest = (nil), , line 75 in "eh_throw.cc"
    [5] OBWebGate_Authent(r = 0xfffffd7fff3fb300), line 86 in "apache.cpp"
    [6] ap_run_post_config(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x444624
    [7] main(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x42c39a
    I am using following link options.
    Compile option is
    /usr/sfw/bin/g++ -c -I/scratch/ashishas/view_storage/build/coreid1014/palantir/apache22/solaris-x86_64/include -m64 -fPIC -D_REENTRANT -Wall -g -o apache.o apache.cpp
    Link option is
    /usr/sfw/bin/g++ -shared -m64 -o apache.so apache.o -lsocket -lnsl -ldl -lpthread -lthread
    At line 86, we are just throwing simple exception which have catch handlers in place. Also we do have catch(...) handler as well.
    Surpursing things are..same issue didn't observe if we make it as executable.
    Issue only comes if this is shared object loaded on webserver. If this is plain shared object, opened by anyother exe, it works fine.
    Can someone help me out. This is completly blocking issue for us. Using Solaris Sun Studio compiler is no option as of now.

    shared object that load into web server process space
    ... same issue didn't observe if we make it as executable.When you "inject" your shared object into some other process a well-being of your exception handling depends on that other process.
    Mechanics of x64 stack traversing (unwind) performed when you throw the exception is quite complicated,
    particularly involving a "nearly-standartized" Unwind interface (say, Unwind_RaiseException).
    When we are talking about g++ on Solaris there are two implementations of unwind interface, one in libc and one in libgcc_s.so.
    When you g++-compile the executable you get it directly linked with libgcc_s.so and Unwind stuff resolves into libgccs.
    When g++-compiled shared object is loaded into non-g++-compiled executable's process _Unwind calls are most likely already resolved into Solaris libc.
    Thats why you might see the difference.
    Now, what exactly causes this difference can vary, I can only speculate.
    All that would not be a problem if _Unwind interface was completely standartized and properly implemented.
    However there are two issues currently:
    * gcc (libstdc++ in particular) happens to use additional non-standard _Unwind calls which are not present in Solaris libc
    naturally, implementation details of Unwind implementation in libc differs to that of libgccs, so when all the standard _Unwind
    routines are resolved into Solaris version and one non-standard _Unwind routine is resolved into gcc version you get a problem
    (most likely that is what happens with you)
    * libc Unwind sometimes is unable to decipher the code generated by gcc.
    However that is likely to happen with modern gcc (say, 4.4+) and not that likely with 3.4.3
    Btw, you can check your call frame to see where _Unwind calls come from:
    where -h -lIf you indeed stomped on "mixed _Unwind" problem then the only chance for you is to play with linker
    so it binds Unwind stuff from your library directly into libgccs.
    Not tried it myself though.
    regards,
    __Fedor.

  • Add ABAP program: validating package - error accessing shared objects-area

    When adding a new program or browsing the packages in eclipse i get an "error accessing shared objects-area".
    I can edit, save and run existing ABAP reports, however.
    There was a similar problem here, regarding database procedure proxies but the solution doesn't apply to my problem, i guess. The solution was about creating the shared memory area CL_RIS_SHM_AREA. I can't access the memory area and start the constructor, as it doesn't show up on the monitor.
    ADT 2.28
    Eclipse 4.3
    Netweaver 7.31 SP4 -> is this really compatible with ADT 2.28?
    Thanks in advance for helpful hints,
    Julian

    HI Julian,
    if the area doesn't show up in the monitor, please try to start the constructor in transaction SHMM on your own by selecting the icon 'Start Constructor' as shown in the screenshot.
    Choose CL_RIS_SHM_AREA as area, select 'Default Instance' and 'Dialog' as execution mode. Then press 'Create'. Either this works or the system will tell you the issue with the instance creation (e.g. insufficient shared objects memory - see the other solution description).
    Best regards, Sebastian

  • Confusion about third-party-libraries in different versions in CE 71.

    Hi
    After some research on the use of different versions of third-party-libraries in SAP netweaver CE 7.1, I am actually quite confused and would be happy if someone could shed a light on that subject....
    1. Is there a way to tell netweaver CE 7.1 to use a library in my WEB-INFlib-folder by simple configuration?
    E.g. we would like to use a third-party-lib in a newer version than the one which is loaded by CE 7.1. Many application server provide a simple configuration option (e.g inside META-INFapplication.xml) where the web as can be forced to use the library inside WEB-INFlib for this application.
    2.Is the concept of "heavy loading" described in a blog by Georgi Danov(Using Hibernate in SAP NetWeaver Composition Environment) the answer to question 1.?
    Does it also work for other third-party-libraries than hibernate? Does it work at all?
    3. In the blog mentioned in question 2, Mr. Danov is talking about "shared libraries". Does this mean, that I have to forget everything about "bundled" and "standard" libraries explained in help.sap.com/CE, if I want to create a heavy loader?
    He is referencing another blog (Applications and shared libraries) which is two years old? Can I still apply the information there to CE?
    4. Are "Bundled libraries" applicable when using different versions of third-party-libraries in CE 7.1?
    In "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    "Bundled libraries: These provide resources only to a single enterprise application, and are packed inside the application's EAR file."
    =>As I want to provide the lib only to my enterprise application, I will probably have to create a bundled library, right? Does this also work if netweaver CE 7.1 uses a different version of the same library?
    5. Do I need Netweaver Developer Studio for creating "bundled" libraries?
    Or can I copy the binaries in the WEB-INFlib-folder of my application, deploy it and use it?
    6. Is configuration of application-j2ee-engine.xml the right place to reference a third-party-library in a specific version which exists in WEB-INF/lib-folder in my application even if it exists also in another version on netweaver?
    => In the document "Troubleshooting: Finding Missing Parent-Child Relations" it says: "To implement the chain of parent-child relations in the deployment descriptor of the component, use either application-j2ee-engine.xml (for applications) or provider.xml (for libraries and services)."
    => "Creating standard libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f447a8d62b0484e10000000a155369/frameset.htm9 tells me, that I have to configure the file application-j2ee-engine.xml, too.
    => But in "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    "Standard libraries: These provide resources to all enterprise applications deployed on the server. They are packed in EAR files like the enterprise applications."
    => Does this mean, that I have to force Netweaver CE 7.1 to use a higher version of a certain third-party-library? Does this even work? Do all applications deployed on Netweaver 7.1 have to use this library in the higher version?
    It is really confusing to read through the documentation!!! Sorry for that avalanche of questions, but I really hope it will make the issue of using libraries (especially if they exist in different versions on the CE 7.1) a little clearer!
    Best regards
    Bettina

    Hi Bettina,
    I'll try to answer your questions:
    >
    > Hi
    >
    > After some research on the use of different versions of third-party-libraries in SAP netweaver CE 7.1, I am actually quite confused and would be happy if someone could shed a light on that subject....
    >
    > 1. Is there a way to tell netweaver CE 7.1 to use a library in my WEB-INFlib-folder by simple configuration?
    >
    > E.g. we would like to use a third-party-lib in a newer version than the one which is loaded by CE 7.1. Many application server provide a simple configuration option (e.g inside META-INFapplication.xml) where the web as can be forced to use the library inside WEB-INFlib for this application.
    >
    First of all, the appropriate docs are here: [http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm|http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm].
    Basically what you do is define a lib project in the studio and deploy it do the server. This may be less comfortable then just configuring manually, therefore it work better in larger environments because the server checks that libs are available in all running instances - which it could not do if you manipulate diretories manually  (an approach you should never attempt in any SAP envrionment)
    > 2.Is the concept of "heavy loading" described in a blog by Georgi Danov(Using Hibernate in SAP NetWeaver Composition Environment) the answer to question 1.?
    >
    > Does it also work for other third-party-libraries than hibernate? Does it work at all?
    >
    If Georgi describes it, I hope so, as he is one of our developers who knows best.
    > 3. In the blog mentioned in question 2, Mr. Danov is talking about "shared libraries". Does this mean, that I have to forget everything about "bundled" and "standard" libraries explained in help.sap.com/CE, if I want to create a heavy loader?
    >
    "shared" are all of theses libs, as otherwise they would be specific to an application.
    > He is referencing another blog (Applications and shared libraries) which is two years old? Can I still apply the information there to CE?
    >
    This was about anearly version of CE and even Georgi updated the blog this year to talk about slight differences. So yes, this still applies.
    > 4. Are "Bundled libraries" applicable when using different versions of third-party-libraries in CE 7.1?
    >
    > In "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    >
    > "Bundled libraries: These provide resources only to a single enterprise application, and are packed inside the application's EAR file."
    >
    > =>As I want to provide the lib only to my enterprise application, I will probably have to create a bundled library, right? Does this also work if netweaver CE 7.1 uses a different version of the same library?
    >
    That depends... Your application uses it's own classloader which means it should only use your libs in case there is another version available on the server. But if you're trying to deploy a lib that is used by a service of the server (int that case loaded by the server not your classloader!) I'm not so sure.
    > 5. Do I need Netweaver Developer Studio for creating "bundled" libraries?
    >
    > Or can I copy the binaries in the WEB-INFlib-folder of my application, deploy it and use it?
    >
    You need the Studio. No way around that. [Edit:] Sorry, misunderstood you here: I thought you want to copy something into the deployed directory on the server! - Of course, any deployment method would do it and though copying binaries seems to be valid. However,  I'm checking this currently with development in detail.
    > 6. Is configuration of application-j2ee-engine.xml the right place to reference a third-party-library in a specific version which exists in WEB-INF/lib-folder in my application even if it exists also in another version on netweaver?
    >
    > => In the document "Troubleshooting: Finding Missing Parent-Child Relations" it says: "To implement the chain of parent-child relations in the deployment descriptor of the component, use either application-j2ee-engine.xml (for applications) or provider.xml (for libraries and services)."
    >
    > => "Creating standard libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f447a8d62b0484e10000000a155369/frameset.htm9 tells me, that I have to configure the file application-j2ee-engine.xml, too.
    >
    > => But in "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    >
    > "Standard libraries: These provide resources to all enterprise applications deployed on the server. They are packed in EAR files like the enterprise applications."
    >
    > => Does this mean, that I have to force Netweaver CE 7.1 to use a higher version of a certain third-party-library? Does this even work? Do all applications deployed on Netweaver 7.1 have to use this library in the higher version?
    >
    >
    >
    > It is really confusing to read through the documentation!!! Sorry for that avalanche of questions, but I really hope it will make the issue of using libraries (especially if they exist in different versions on the CE 7.1) a little clearer!
    >
    > Best regards
    > Bettina
    Could you tell me what you're trying to deploy? I'll try to get Georgi on this....
    Regards,
    Benny
    Edited by: Benny Schaich-Lebek on Nov 5, 2008 1:40 PM

  • 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);

  • Having problem displaying remote shared objects on flash

    hi
    I am using red5 flash server and at that side creating a shared object called chatSharedObject
    For the client side,I am using openlaszlo platform, but using actionscript 3  classes for the shared object implementation. cilent application is connecting to the shared object on the red5 side successfully(as I see on the red5 logs).
    here is the calling code snippet:
    [CODE]
    <button id="sendButton">send
          <handler name="onclick" method="sendClicked" />
          <method name="sendClicked" args="v=0">
            if (message.text != "") {
        //Debug.write("Message sent!");
        classroot.writeSharedObject(message.text); 
        message.clearText();
        message.setAttribute("text_y", 0);
        </method>
    </button>
    <method name="writeSharedObject" args="message">
    [B]//shared object send method is being called[/B]
        this.send("writeMessage",loginScreen.getUsername(),message);
    </method>
    <!--this method writes the messages to the debug window which will be shown to all users-->
    <method name="writeMessage" args="username, msg">
        //Debug.debug(msg);
        messageArea.addText(username+ " : "+msg+"\n");
    </method>[/CODE]
    When I generate the flash object and try to use this application, nothing is being displayed although there is no problem on this issue on the development enviroment. Problem causes when I try to run the swf10 flash object.
    Is this maybe a flash security issue? Although I have added the corresponding locations as the trusted location on the flash settings manager. Still problem goes on. And I think this is not about the flash player, it might be a special problem about the flash object.
    Couldn't find the solution for a week,
    Any help would be appreciated.
    Thanks in advance 
    Cem

    i can even gointo firefox and chrome and save the shared object. then open my i.e and see that object in the results page. but if i save the shared object in i.e it throws that error on the results page. So i'm pretty sure it must be the flushing of the object. Pasting my save code below:
    function makeResult(evt:MouseEvent):void{
          var flushstatus:String = new String();
          gSo.data.o = o;
          gSo.data.c = c;
          gSo.data.t = t;
          gSo.data.c = v;
          gSo.data.u=uid;
          flushstatus = gSo.flush();
          if (flushstatus != null) {
            switch (flushstatus) {
              case SharedObjectFlushStatus.PENDING: //this is incase the user doesnt have enough space
                gSo.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
                break;
              case SharedObjectFlushStatus.FLUSHED:
                redirect();
                break;
    function onFlushStatus(event:NetStatusEvent):void {
      switch (event.info.code) {
        case "SharedObject.Flush.Success":
          gSo.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
          redirect();
          break;
        case "SharedObject.Flush.Failed":
          trace ("Shared object storage failed");
          break;
    function redirect() {
      try{
        var request:URLRequest = new URLRequest('../node/2');// i supply a base parameter to the swf so the redirect works
        navigateToURL(request,"_self");
      catch(error:Error){
        trace ("Redirect failed");

  • 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.

  • Confused about extending the Sprite class

    Howdy --
    I'm learning object oriented programming with ActionScript and am confused about the Sprite class and OO in general.
    My understanding is that the Sprite class allows you to group a set of objects together so that you can manipulate all of the objects simultaneously.
    I've been exploring the Open Flash Chart code and notice that the main class extends the Sprite class:
    public class Base extends Sprite {
    What does this enable you to do?
    Also, on a related note, how do I draw, say, a line once I've extended it?
    Without extending Sprite I could write:
    var graphContainer:Sprite = new Sprite();
    var newLine:Graphics = graphContainer.graphics;
    And it would work fine. Once I extend the Sprite class, I'm lost. How do I modify that code so that it still draws a line? I tried:
    var newLine:Graphics = this.graphics;
    My understanding is that since I'm extending the Sprite class, I should still be able to call its graphics method (or property? I have no idea). But, it yells at me, saying "1046: Type was not found or was not a compile-time constant: Graphics.

    Thanks -- that helped get rid of the error, I really appreciate it.
    Alas, I am still confused about the extended Sprite class.
    Here's my code so far. I want to draw an x-axis:
    package charts {
        import flash.display.Sprite;
        import flash.display.Graphics;
        public class Chart extends Sprite {
            // Attributes
            public var chartName:String;
            // Constructor
            public function Chart(width:Number, height:Number) {
                this.width = width;
                this.height = height;
            // Methods
            public function render() {
                drawAxis();
            public function drawAxis() {
                var newLine:Graphics = this.graphics;
                newLine.lineStyle(1, 0x000000);
                newLine.moveTo(0, 100);
                newLine.lineTo(100, 100);
    I instantiate Chart by saying var myChart:Chart = new Chart(); then I say myChart.render(); hoping that it will draw the axis, but nothing happens.
    I know I need the addChild method somewhere in here but I can't figure out where or what the parameter is, which goes back to my confusion regarding the extended Sprite class.
    I'll get this eventually =)

Maybe you are looking for

  • Nuget packages are not uninstalled properly in VS 2010

    Hi, I have created 3 Nuget packages. One package is dependency of other two Nuget packages. Once I install the 3 packages in my project it installed and working fine. If I uninstall the nuget from my VS2010 project it will throw the below messages. A

  • F110 use of program.

    Hi SAP Experts, During F110 in printout/data medium TAB, there is a colum for Pragram EG: RFFOAVIS_FPAYM etc.....i am confused to use which one & when. What is the use of this program and in the bottom line List is also there where also there are pro

  • Display three Values in Pie charts

    Hi All, I want to display three Values in Pie Chart(%, Value and one more field). Please suggest me any solution for this. For Eg Pie chart should display value lie this :- Nokia, 25,025, 38.52% (It consists of three differet values) Thanks,

  • TRIGGER: strange errors

    hi, to those who helped me before:(it's the same trigger). CREATE OR REPLACE TRIGGER log_sal_update BEFORE UPDATE ON emp FOR EACH ROW WHEN ((new.sal/old.sal)>1.5) DECLARE v_CountRow INTEGER; PRAGMA AUTONOMOUS_TRANSACTION; BEGIN SELECT count(1) INTO v

  • Submit disabled form field value?

    Is it possible to disable a form field, but still have it be included in the request object on the form handler page? For instance, I have a field that is required and the customer wants it disabled so it can't be changed until another checkbox is se