Multiple instances of a Singleton-Object by updaterule ?

Hi folks,
I'm trying to load > 1 Mio. records from an ODS into another InfoProvider. Every record gets some keyfigures out of a very very expensive table-join.
I tried creating this join in an ABAP-Singleton-Object to reduce uploading-time.
This object holds a private-static attribute 'instance' as a reference to a instance of the object and a public-static 'getInstance()'-method, which returns the 'instance'-value. This method is standard-Singleton-like designed.
Then I created a process-chain with:
- an ABAP-process, which calls the 'getInstance()'-method
  of this Singleton.
  At the first pass this method calls the constructor and
  after that a private method, which creates the join and
  holds the result in an internal table.
  So the constructor is empty.
- after that the data should be transfered (by an Info-
  Package) from the ODS to the other InfoProvider. In some
  fields of the update-rule and in the startroutine of
  the rule the 'getInstance()'-method of the Singleton is
  been called and by this reference to the only (so I
  thought) instance some other methods should return a
  calculated value out of the join.
So theory .... the startroutine is been called for multiple datapackages (no problem) --- but for every package in the startroutine the 'getInstance()'-method calls the constructor, so I get multiple instances of a Singleton.
The time-gap between the package-calls is > 10 secs., so the static-attribute should been set immediately in the first pass of the 'getInstance()', since the constructor is empty.
    Any ideas ???
    Bye Ralf

-/-

Similar Messages

  • How to create Multiple instances of This SingleTon class

    import java.io.*;
    import java.util.Properties;
    import java.net.URLEncoder;
    public class ddd
              // declaring variables
              static private ddd _instance;
              String connectIP;
              int connectPort;
              String systemID;
              String password;
         String systemType;
              // Constructor with arguments
              private ddd()
              globalInit();
         // method returning the ddd instance.
              public static      synchronized ddd getInstance()
              if (_instance == null)
                        _instance = new ddd();
              return _instance;
              // Global initialisations
              public void globalInit()
              systemID ="XXXXX" ;
              password ="XXXXX";
              systemType ="Null";
              public static void main(String[] args)
                   ddd sb;
                   sb = ddd.getInstance();
                   System.out.println(ddd.getInstance());

    Don't cross-post:
    http://forum.java.sun.com/thread.jsp?thread=547911&forum=54&message=2669925
    http://forum.java.sun.com/thread.jsp?thread=547912&forum=31&message=2669928
    Sorry, I can't help but think that this is one of the more foolish questions I've read in a while.
    The pattern Singleton means "I only want one of these in a single JVM". If you want multiple instances, or even a restricted number of instances, then rewrite the class (something like this):
    public class LimitedEdition
        public static final int MAX_EDITIONS = 3;
        private static int numEditions;
        public static void main(String [] args)
            try
                if (args.length > 0)
                    int numEditions = Integer.valueOf(args[0]).intValue();
                    for (int j = 0; j < numEditions; ++j)
                        LimitedEdition limited = new LimitedEdition();
                        System.out.println(limited);
            catch (Exception e)
                e.printStackTrace();
        public LimitedEdition() throws InstantiationException
            if (numEditions < MAX_EDITIONS)
                ++numEditions;
            else
                throw new InstantiationException("Only " + MAX_EDITIONS + " instances allowed");
        public String toString()
            return "[ instance # " + numEditions + "]";

  • How can we destroy the instance of a singleton object?

    I think by writing a method like getInstance and making null in that method will not the correct answer of this. Can someone tell me what should I do.

    why do you need to destroy the singleton?
    normally..it should live for the duration of the application.
    most singleton i've worked with are used by sevarals different classes.
    if you're singleton use by only one class...refactor your code to make the singleton an inner class. so the singleton will be destroy when that class is no longer references 9and gc kick in)
    if the singleton is share among several class...you can have a destroy method...like destroyInstance() where you null the singleton. keep in mind about synchronization of the method as well as the instance ... example createInstance() and destroyInstance() get call at the same time.. Also, make sure you have condition to check to determine if your singleton class is null or not
    example
    MySingleton s = MySingleton.createInstance();
    Object obj = s.getData(); // what happen when another thread call MySingleton.destroyInstance() you're s.getData would result in NullPointerException
    so..it's not wise to destroy a singleton.
    I think what is better for your app is an Object Pool that create new instance (if none exist) and hand it out to any requester...and recycle the object...or null it after use)

  • Returning multiple instances of the same object?

    I have a fairly straight forward swing test class that contains a combobox. The problem is that an object is not selected in the combobox because I get different objects when building the list and when setting the selected item.
    To test this, I've added the following set of 4 lines on three locations in the code:
    - immediately after Toplink is initialized
    - when setting the selected item
    - when the main exits (and the JFrame is open)
    Stand s = Stand.findByPK(4).getDerrivedfromstand();
    System.out.println( s + ", Using EM #" + Integer.toHexString( lEntityManager.hashCode() ) );
    s = Stand.findByPK(1);
    System.out.println( s + ", Using EM #" + Integer.toHexString( lEntityManager.hashCode() ) );
    I happen to know that Stand 4 is derrived from Stand 1. So I get Stand 1 once via Stand 4 and once directly. The result is:
    java.vm.version=1.6.0-b105
    [TopLink Info]: 2007.05.30 11:01:10.531--ServerSession(33414193)--TopLink, version: Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))
    [TopLink Info]: 2007.05.30 11:01:11.343--ServerSession(33414193)--file:/C:/Documents%20and%20Settings/toeu/My%20Documents/kp/reinders/reinders/voorraad/container/bm/build/-reinders login successful
    // immediatly after Toplink init
    [1] setObject=4 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@1866417, Standnr=1, Using EM #1a8e53c
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@1866417, Standnr=1, Using EM #1a8e53c
    // when filling a combobox in the GUI
    executeQuery: SELECT ... FROM stand ORDER BY standid ASC
    getElementAt 0 = nl.reinders.bm.Stand@1866417, Standnr=1
    // when setting the value of the combobox
    executeQuery: SELECT ... FROM stand ORDER BY standid ASC
    [1] setObject=4 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@171ef98, Standnr=1, Using EM #1a8e53c
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@171ef98, Standnr=1, Using EM #1a8e53c
    // when exiting the main (JFrame is open)
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@171ef98, Standnr=1, Using EM #1a8e53c
    [1] setObject=4 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@171ef98, Standnr=1, Using EM #1a8e53c
    [1] setObject=1 / SELECT ... FROM stand WHERE (standnr = >>>HERE<<< )
    executeQuery: SELECT ... FROM stand WHERE (standnr = ?)
    nl.reinders.bm.Stand@171ef98, Standnr=1, Using EM #1a8e53c
    What is amazing is that somewhere after the combobox is filled, the query returns another instance of the same record and thus the select item will not find an "equal" object in the list. Any suggestions?

    Nevermind. A clear was done on the EM somewhere down the line.

  • Using multiple instance variables or BPM objects in a single JSP

    In my screenflow, for an user activity, I've selected a BPM object variable for my JSP and using this BPM object variable within the JSP to display or accept values related to this BPM object.
    But in certain circumstances, I need access to some of the instance variables defined in my screenflow (which are not members of the BPM object), and to get these variable values displayed in my JSP. I don't want to overload my BPM object with all these instances as they do not logically fit as members in this BPM object.
    For example, if I need to capture and display the logged in user name across the JSPs in my web application, then how can I do that without specifying this user variable in all of my BPM objects.
    Is there any extensibility in using more than one BPM object variables in my JSPs? Why is it that a single BPM object variable is tied to a JSP? Or am I missing something else here?

    I'm with the same problem!

  • I'm having problems in a GOOP applicatio​n with multiple instances of the same object running simultaneo​usly.

    I?ve written an application to control a system with multiple lamps. Each lamp in the system has its own power supply. Each lamp object contains a reference to its power supply. The application contains an array with the references to all the lamps in the system. Each lamp is in charge of monitoring itself and setting its power supply?s voltage according to the applications commands, therefore each lamp needs that its ?run me? method will run as long as the application is running i.e. the run method has to be reentrant. Because there are multiple lamps and because the ?run me? methods for each lamp run simultaneously, to over come this problem each lamp has a met
    hod ?run? that calls ?run me? with ?RUN VI? invoke node with the ?Wait until done? set to false. When I run the application, it seems to work but if I check the AO there is no change in the output, and the lamps seem to be reading their input from the same channel. I can?t seem to find the problem, I think that the fact that the method is reentrant causes some sort of mix-up in the separate object references. Also because the method is reentrant I can?t debug it (with one lamp it seems to work ok). Does anyone have any idea what could be causing this problem.
    P.S I'm having problems attaching my sample program to this message. You can contact me at [email protected] to recive the sample program I wrote.

    Jean, Thanks for your answer, I've tried checking the invoke node that calls the "Run VI" method but it doesnt return an error any of the times its called even that the Vi that it called is still running. I also tried your solution of changing the object's "Run" method to a template but that doesnt work either. I can't seem to post the sample progam that demonstrates the problem, is it possible to send it to you by email, contact me at [email protected]
    Attachments:
    Sample_program.zip ‏926 KB

  • How to reference multiple instances of the same Java object from PL/SQL?

    Dear all,
    I'm experimenting with calling Java from PL/SQL.
    My simple attempts work, which is calling public static [java] methods through PL/SQL wrappers from SQL (and PL/SQL). (See my example code below).
    However it is the limitation of the public static methods that puzzels me.
    I would like to do the following:
    - from PL/SQL (in essence it needs to become a forms app) create one or more objects in the java realm
    - from PL/SQL alter properties of a java object
    - from PL/SQL call methods on a java object
    However I fail to see how I can create multiple instances of an object and reference one particular object in the java realm through public static methods.
    My current solution is the singleton pattern: of said java object I have only 1 copy, so I do not need to know a reference to it.
    I can just assume that there will only ever be 1 of said object.
    But I should be able to make more then 1 instance of an object.
    To make it more specific:
    - suppose I have the object car in the java realm
    - from PL/SQL I want to create a car in the java realm
    - from PL/SQL I need to give it license plates
    - I need to start the engine of a scpecific car
    However if I want more then 1 car then I need to be able to refrence them. How is this done?
    Somehow I need to be able to execute the following in PL/SQL:
    DECLARE
    vMyCar_Porsche CAR;
    vMyCar_Fiat CAR;
    BEGIN
    vMyCar_Porsche = new CAR();
    vMyCar_Fiat = new CAR();
    vMyCar_Porsche.setLicensePlates('FAST');
    vMyCar_Porsche.startEngine();
    vMyCar_Fiat.killEngine();
    END;
    Thanks in advance.
    Best Regards,
    Ruben
    My current example code is the following:
    JAVA:
    ===
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED CODAROUL."RMG/BO/RMG_OBJECT" as package RMG.BO;
    public class RMG_OBJECT {
    private static RMG_OBJECT instance = new RMGOBJECT();
    private String rmgObjectNaam;
    private RMG_OBJECT(){
    this.rmgObjectNaam = "NonDetermined";
    public static String GET_RMGOBJECT_NAAM () {
    String toestand = null;
    if (_instance == null) {toestand = "DOES NOT EXIST";} else { toestand = "EXISTS";};
    System.out.println("instance : " + toestand);
    System.out.println("object name is : " + _instance.rmgObjectNaam);
    return _instance.rmgObjectNaam;
    public static Integer SET_RMGOBJECT_NAAM (String IN)
    try
    _instance.rmgObjectNaam = IN;
    return 1;
    catch (Exception e)//catch
    System.out.println("Other Exception: " + e.toString());
    e.printStackTrace();
    return 5;
    } //catch
    PL/SQL Wrapper:
    ==========
    CREATE OR REPLACE FUNCTION CODAROUL.SET_RMGOBJECT_NAAM(NAAM IN VARCHAR2) return NUMBER AS
    LANGUAGE JAVA NAME 'RMG.BO.RMG_OBJECT.SET_RMGOBJECT_NAAM (java.lang.String) return java.lang.Integer';
    Calling from SQL:
    ==========
    CALL dbms_java.set_output(2000);
    select CODAROUL.GET_RMGOBJECT_NAAM() from dual;
    Edited by: RubenS_BE on Apr 6, 2012 5:35 AM
    Edited by: 925945 on Apr 6, 2012 5:41 AM

    You can do this by manually creating a new iterator binding in your binding tab.
    So instead of dragging the VO directly to the page, go to the binding tab, add a new executable iterator binding, and point to that one from your ELs in the page itself.

  • Creating multiple instances of a class in LabVIEW object-oriented programming

    How do you create multiple instances of a class in a loop?  Or am I thinking about this all wrong?
    For instance, I read in a file containing this information:
    Person Name #1
    Person Age #1
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #2
    Person Age #2
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #3
    Person Age #3
    Hobby #1
    Hobby #2
    Hobby #3
    If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?
    FYI, new to LabVIEW OOP but familiar with Java OOP.  Thank you!

    First of all, let's get your terminology correct.  You are not creating multiple instances of a class.  You are creating Objects of the class.
    Use autoindexing to create an array of your class type.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Shared Objects: How to store and read multiple instances

    Hi,
    Can we store multiple instances of Shared Objects in memory and read the desired instance.
    e.g
    If i execute the below program twice then also it will create only a single instance in the memory.
    Can we create a memory object with a key and then read the instance with the object with key
    data: handle type ref to ZCL_SHM_AREA_XX,
          root   type ref to ZCL_SHM_AREA_ROOT_XX.
    handle = ZCL_SHM_AREA_XX=>attach_for_write( ).
    create object root AREA HANDLE handle.
    root->FORM = 'Termination'.
    handle->set_root( root ).
    handle->detach_commit( ).

    Hi Sameer,
    check my reply to Recursive methods..
    Cheers
    Graham Robbo

  • Loading multiple instance of a

    Hi,
    I'm trying to develop a Java application with Avetana Bluetooth. This library is a complete stack for Bluetooth in Java. The big problem is the hardware interface: Avetana can get only one instance for each java application running on it. So, if I have multiple hardware interface on my system, I must run multiple JVM with my application...
    This happen because the Avetana library have a lot of static variable to hold some reference to the bluetooth hardware.
    The big question is: can I make some Java code to create & run multiple instance of my Bluetotth code, so each Avetana Library is TRULY loaded in a ISOLATED context (so the static variables are independent each from others)?
    I've tryed with custom classloading but nothing...
    Here is the code from main() on StaticTestClassLoader (a code used for testing).
    MyBT is the Bluetooth class wich load the Avetana library on hardware interface (specified by the method initStack(int hardwareInterfaceID)).
    URL[] url = { new File("subdir").toURL() }; // because MyBT.class is in the "subdir" folder
    URLClassLoader cl1 = new URLClassLoader(url);
    URLClassLoader cl2 = new URLClassLoader(url);
    URLClassLoader cl3 = new URLClassLoader(url);
    Class<MyBT> c1 = (Class<Dummy>)cl1.loadClass("MyBT");
    Class<MyBT> c2 = (Class<Dummy>)cl2.loadClass("MyBT");
    Class<MyBT> c3 = (Class<Dummy>)cl3.loadClass("MyBT");
    Object bt1 = c1.newInstance(); // this is line 22 where exception rise up
    Object bt2 = c2.newInstance();
    Object bt3 = c3.newInstance();
    ((MyBT)bt1).initStack(0); // run my Bluetooth application on hardware interface #1
    ((MyBT)bt1).initStack(1); // the same but on hardware interface #2
    ((MyBT)bt1).initStack(2); // the same but on hardware interface #3No error while compiling, but when running:
    Exception in thread "main" java.lang.NoClassDefFoundError: MyBT
            at StaticTestClassLoader.main(StaticTestClassLoader.java:22)this happen if I didn't add on classpath the MyBT class in the "subdir". If I add it, it works but all three instance are in the same context and the library doen't load the right hardware interface...
    If I omit the obejct assignement with bt1, bt2 and bt3 it works in both scenarios, but I haven't any reference to the new instantiated classes ...(so I can't call methods on there!)
    Any idea, web link or suggestion?
    Thanks in advance, best regards,
    Francesco Pessina.

    I think the question is detalied in an unclear manner. The substance of my question is:
    - I have some code in a library with static variables.
    - if I load (instantiate) this library one, twice or more, this static variables have all the same value because are static and live in the same JVM/context
    - the need is to load & use this library multiple time (two or more "instance" of it) from the same application in a single JVM.
    So my trouble is to write some Java code that create a runtime different context spaces in the (single) JVM so I can run this "static" library more times (one library for each context).
    I've tryed with classloader and singleton but all instantiated class have always the same context, so the library have (in all the created instance) always the same static variable values.
    Sorry for my english, have a good new year!
    Regards,
    Francesco.

  • How do I prevent a user from opening multiple instances on the same computer?

    On the site oldnavyweekly.com there is a .swf that prevents users from opening multiple instances of the site at the same time on the same computer. If you open the site, and try to open it a second time in another window, it won't load. You can't open the site again until the first window is closed. How did they implement this?
    From my analysis it is NOT:
    1. Cookies - The block still takes place if you try opening it in IE and also try opening it in Firefox simultaneously.
    2. Flash Cookies - The block still takes place if I disable flash cookies.
    3. IP Based Block - You are not blocked if you open the site on two separate computers with the same outbound IP address. From my analysis, their server does not assist in the block at all.
    It seems as if their .swf is creating some kind of global system-wide object that can be detected in other instances of the application on the same machine. How did they implement this?
    Thanks!

    you're welcome.
    actually, unless you take an extra step, the first opened swf will close.  if you want the 2nd to close, the initial receiving lc will send a message to sender that causes the sender to close.

  • Multiple instances of the same bean class in session?

    I�m trying to think of a way to have multiple instances of the same bean class in session scope using JSF. For example, let�s say that I have two <h:dataTable>s on the same page. They both use the backing bean called genericBean. Now, the content for genericBean will be different for each <h:dataTable>. In fact, the data source that backs genericBean is not known until runtime. It could be a database, web service, etc.
    What I would like is for when JSF needs access genericBean instead of looking for the value with key �genericBean� in the session map it looks for �genericBean_[some runtime ID]�. I could specify this id in EL on a custom component, as a request parameter or whatever.
    I think that I need the bean to be in session scope because the tables are complex and I want them to be editable.
    I have some ideas about how I can do this but I was wondering if someone has already solved this problem or if there is a standard way to do this using tools like Shale, etc.
    Thanks,
    Randy

    Well, I came up with an interesting solution to this so I thought that I would post it here.
    I have a page that looks like this.
    <html>
    <head>
    <title>My Page</title>
    </head>
    <body>
    <f:view>
    <f:subview id="component1">
    <jsp:include page="component.jsp">
    <jsp:param name="id" value="a" />
    </jsp:include>
    </f:subview>
    <hr>
    <f:subview id="component2">
    <jsp:include page="component.jsp">
    <jsp:param name="id" value="b" />
    </jsp:include>
    </f:subview>
    </f:view>
    </body>
    </html>
    And component.jsp looke like this.
    <f:verbatim>
    <p>
    <h1>Component
    </f:verbatim>
    <h:outputText value=" #{param.id}" />
    <f:verbatim>
    </h1>
    </p>
    </f:verbatim>
    <h:form>
    <h:outputText value="#{component.id}" />
    <h:outputText value="#{component.value}" />
    <h:commandButton value="increment" action="#{component.increment}" />
    <h:commandButton value="decrement" action="#{component.decrement}" />
    <f:verbatim>
    <input type="hidden" name="id"
    value="</f:verbatim><h:outputText value="#{param.id}"/><f:verbatim>" />
    </f:verbatim>
    </h:form>
    The idea is that I want component.jsp to be initialized differently based on the id param. The component managed bean is configured to be in session scope but I want the component instance for id a and id b to be different instances in session scope. Therefore, I added a custom variable resolver to handle this.
    public Object resolveVariable(FacesContext context, String name) {
    // This id will be different for the different subviews.
    HttpServletRequest request = (HttpServletRequest) context.getExternalContext() .getRequest();
    String id = request.getParameter("id");
    // If there is an id in the request then check if this is a bean that can have multiple
    // instances in session scope.
    if ((id != null) && (id.length() > 0)) {
    ExternalContext ec = context.getExternalContext();
    // Build the new name for the key of this bean
    String newName = name + "_" + id;
    Object value = null;
    // See if the bean instance already esists.
    if ((null == (value = ec.getRequestMap().get(newName))) &&
    (null == (value = ec.getSessionMap().get(newName))) &&
    (null == (value = ec.getApplicationMap().get(newName)))) {
         // We could not find the bean instance in scope so create the bean
         // using the standard variable resolver.
    value = original.resolveVariable(context, name);
    // Now check if the bean implements that page component interface. If it is
    // a page component then we want to rename the key to access this bean so
    // that the instance is only used when the id is provided in the request.
    // For example, if there are two components (a and b) we will have in session scope
    // component_a and component_b. The will each point to a unique instance of the
    // Component bean class.
    if (value instanceof PageComponent) {
    // Try to get the value again
    if (null != (value = ec.getRequestMap().get(name))) {
         // Initialize the bean using the id
    ((PageComponent) value).initInstance(id);
    ec.getRequestMap().remove(name);
    ec.getRequestMap().put(newName, value);
    } else if (null != (value = ec.getSessionMap().get(name))) {
    ((PageComponent) value).initInstance(id);
    ec.getSessionMap().remove(name);
    ec.getSessionMap().put(newName, value);
    } else if (null != (value = ec.getApplicationMap().get(name))) {
    ((PageComponent) value).initInstance(id);
    ec.getApplicationMap().remove(name);
    ec.getApplicationMap().put(newName, value);
    return value;
    return original.resolveVariable(context, name);
    }

  • Multiple instances of Page Flows

    I have a legacy application that I am working on migrating to Weblogic. The
    legacy application allowed the user to have multiple windows of the same
    module open at the same time. Users found this useful if they wanted to look
    at two different records in the same module. For example, if you had a
    registration app and you wanted to look at Joe's registration information
    and Sue's registration. Is it possible to have two browsers within the same
    session open and pointing to the same RegistrationController.jpf?
    We currently have our form beans stored in the page flow which seems to
    cause a problem as when we open another browser instance in the same session
    pointing to the same page flow, the form beans from the first window are
    overwritten. An approach we are possbily looking at is to store the form
    beans in an object in the session and identify a set of form beans as
    belonging to a particular window instance - perhaps by uniquely naming the
    windows as they are opened.
    Has anyone done this before with needing to have multiple instances of the
    same page flow or multiple instances of different non-nested page flows open
    at the same time?
    Michelle

    Hi Vijay,
    Thanks for the reply, But that's not the right aproach.
    I cannot change the application to stateless, Since the standard application where the page resides is statefull.
    Also some of the business logic I cannot achive with stateless application
    Regards
    Geogy

  • Multiple instances of FileOutputStream

    Hi, I'm learning how to use Java's multithreading features. I created a class called "ObjectMaker". An instance of this class serializes some objects into a file, using a FileOutputStream (inside an ObjectOutputStream) for writing. In the mean time an other object of another class deserializes those objects reading from the file. Each concurrent access to the file (for writing,reading) is synchronized. Here's the problem:[ u]if each writer has its own FileOutputStream, then the concurrent writing on the file doesn't work (despite of every writer is synchronized on the same object), and the reader aren't able to read anything from the file; if the FileOutputStream is static (every instance share the same FileOutputStream reference) everything works. I read on Documentation that some OS "allow a file to be opened for writing by only one FileOutputStream (or other file-writing object) at a time" .But it also says that I would recive an exception from FileOutputStream if I try to open a file for writing that is already open by another FileOutputStream....and It doesn't happen, no exception are thrown.Then here is the problem:It's possible to manage Multiple instances of FileOutputStream linked on the same file?

    Hello Joseph,
    Have u been successful on the installation.
    There were no replies after yours.
    Can you please let me know about installing 2 MDS instances on the same host.
    If you have any document you followed please mail me to [email protected]
    It will be more helpful as the dead line to this is killing me.
    Regards,
    VishnuM

  • Multiple instances of the same VI running in parallel

    Hi,
    I have a timestamping subVI that looks at a counter channel and applies timestamps. I want to create multiple instances of this subVI (8 to be exact) and have them all run in parallel (looking at 8 different channels). Someone gave me the following advice:
    >>
    Also, in case you want to call multiple instances of the same SubVI, and you want these multiple instances to execute in parallel, you will have to set the SubVI to execute in reentrant mode. Do this by opening the SubVI and going to "Edit >> VI Properties >> Execution" and enable "Reentrant execution".
    <<
    I've tried this but only my second instance (I started simple with only 2 instances) seems to monitor its channel and pass data along to the queue. I've included my code below, I have two signal simulators which simulate singles coming in on channels 2 and 3. I'm using a PCQI 6602 counter/timer card.
    Any help would be greatly appreciated, thanks in advance,
    Chris
    Attachments:
    LabView App (June 28, 2005).zip ‏158 KB

    good news! Your reentrant VI is working and all three instances are running (as execution highlighting clearly shows). The problem is going to be an error that is occuring but you don't see because you are ignoring the error clusters internally in the timer. It looks like at one point it was set to quit if an error occurred. That still needs to be there.
    Always hookup error clusters...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Lion 10.7(.1) wake from sleep bug? help?

    When opening my computer the screen turns on instantly but the trackpad/mouse and keyboard are unresponsive for 2-3 seconds. I've searched around and can't find many people with the same problem... or nobody seems to mind?? I only have this problem w

  • BOM CHANGE MANAGEMENT

    HI,    we r changing bom with change number. we changed one bom with one change number(validty next month date).now that change number has not been used for any other bom changes.i want to restrict that change number for further use.. can i activate

  • When situation causes Firefox cache file to have Windows modified date more recent than the access date?

    I'm reviewing a report from a forensic examination of a hard drive from a Windows machine. In that report are Firefox 3.x cache files where the Windows modified date is more recent than both the Windows created date and the Windows accessed date, wit

  • Enhancement for QA32 Inspection lot stock tabs

    Hello everybody:    In QA32  user can do UD operation in "Characteristics" tabs and do Posting operation in "Inspection lot stock" tabs.    phase 1: I use QEVA0010 enhancement to check UD  in "Characteristics" tabs and it works.    phase 2: I need to

  • Preloader won't launch in SABA (Captivate 4)

    Hi, I have published a SWF file that I then inserted into an Articulate Presenter presentation. I uploaded this course to Saba LMS. When the Captivate launches, the preloader doesn't run. I just see a white blank screen while the course getting ready