Restricting multiple instances of an application

Hi, how can I restrict an application from loading more than one of its instance at a time.
Thanks

The first step is to search the forums...
http://forum.java.sun.com/thread.jsp?forum=4&thread=310327&start=1&range=1

Similar Messages

  • How to use/sync single data (file) across multiple instances of same application

    Currently we have an application (a diagram editor), that have the ability to save and load (serialize) its state in a xml file.
    Now we want this application to behave like Microsoft OneNote application. Where multiple users have the ability to access the same file.
    Later we may also need to enhance with other things like, (1)what is changed and who changed it, (2)option to resolve conflicts if any.
    I came to know about sync framework to resolve this. so far, i have not tried it.
    All i want is,
    Virtually single file should be edited by multiple instances of same application.
    We need a dll (sync framework) that does following
    It takes complete responsibility of file handling.
    Using this dll, each instance of the application will notify their own changes.
    Each instance of the application should have the ability to detect the changes that is recently made (when, who, what are the changes).
    My question:
    Will sync framework be suitable for this requirement?
    If so, is there a demo application that represents this?
    - Jegan

    Seems like I have found the solution.
    In the taskflow there is a property named data-control-scope and I set it to isolated instead of the default (shared) and this seemed to do the trick.
    I can now have two instances of the same taskflow running with different ApplicationModules
    Cheers,
    Mark

  • Detecting multiple instances of same application on startup.

    How can I detect multiple instances of same application on startup? I would like to display a message to the user stating that the application is already running [and then close out].

    How can I detect multiple instances of same
    application on startup? I would like to display a
    message to the user stating that the application is
    already running [and then close out].Congratulations on being the bazillionth person to ask this kind of question without bothering to search the internet.

  • Static member problem in multiple instance of  web application

    Problem
    I am working on a product which is java based. I have a war file. I have to deploy this war file in JBoss. Further, I need to run multiple instance of this war file in same JBoss instance.
    Issue
         In that war file there is servlet Start.java. That servlet calls an other class from its init method. Here is code
    public class Start extends HttpServlet
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              DB.loadProperties (�db.properties�);
         } // init
         public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException
                   } // doGet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException
                   } // doPost
    } // Start
    public final class DB implements Serializable
         public static final String     P_UID = "ApplicationUserID";
         private static final String     DEFAULT_UID = "System";
         public static final String     P_PWD = "ApplicationPassword";
         private static final String     DEFAULT_PWD ="System";
         public static final String     P_STORE_PWD = "StorePassword";
         private static Properties           s_prop = new Properties();
    public static boolean loadProperties (String filename)
         {    // looks for properties file
    s_prop = new Properties();
              FileInputStream fis = null;
              try
                   fis = new FileInputStream(filename);
                   s_prop.load(fis);
                   fis.close();
              catch (FileNotFoundException e)
                   log.warning(filename + " not found");
                   loadOK = false;
         �}
    As you can see if I deployed two instance of this war in JBoss and assume each instance point to its own properties file. The �Static� members are problem.
    Restriction
         I am not allowed change the code or logic of the product. I must be able to get some thing outside or apply a patch to solve this problem.
    Please Help
    Possible option that I have thought
    1 Using multiple JVM - Not an option in this project
    2 Using multiple JBoss � Not the requirement (need to run only on single Instance of JBoss)
    3 Use own class loader for war/ear � don�t know how in JBoss need help.
    I am using JBoss 3.2.3
    Thanks,
    Kumaran

    Static members belong to the class. So, you needto
    think of multiple JVMs for your problem.Thanks for reply.
    don�t know how in JBoss need helpJust guessing... clustered environment MAYBE
    RichThanks Rich,
    I don�t know how Cluster environment solve my problem. I need more information on your thought. Cloud you explain it.
    Kumaran

  • Multiple Instances of Same Application Icons in iTunes App Folder

    I recently sync'ed my iPhone to iTunes on my MBP. After doing so I noticed that in the iTunes application folder there was 2 icons for each of my application that I have. Only one icon though on my iPhone. Running a sync a third time I got 3 icons in the applications folder for each application, but again only one instance of the application icon on my iPhone.
    I am not sure why this is occuring, but need some help to ensure that iTunes is reflecting the applications correctly.
    Why this is importance, is I can now no longer update my paid applications, via the iPhone and the Apps Store shows I need the same update 3 times, but will not download, as it claims the update was already performed.
    Something is messed up and need some guidance and help. PLEASE
    Thanks

    Yes, I migrated my iTunes directory, and after the migration, everything looked fine. Only one set of icons. It was not until I started to sync the itunes on my new MBP that the duplicating of icons started.
    I try to delete the duplicate icons, but in doing so it will delete the application on the iPhone.
    It there a registry that stores the icon to file associations?
    If I look in the music/iTunes/Mobile Applications folder there is only 1 instance of the *.ipa for each application. So why does iTunes have 3 copies of the icons pointing to the one *.ipa file. There must be an internal itunes registry that has made the icon associations. That is what needs cleaning out. I just do not know where that would be, given there is only one *.ipa file under the iTunes file structure.
    Can anyone help determine how to clean up the multiple icons?
    Thanks

  • JDev 11g: Multiple Instances of Same Application Using Same AppModule !?

    Hi Everyone,
    I'm having difficulties with multiple instances of taskflows and their application modules.
    I have a main application which has two separate instances of a taskflow (another application with it's own appmodule). I would like for the two separate instances to use separate instances of their application module but that is not happening.
    How can I set this up ? I would like instance 1 to have it's own application module and instance 2 to have it's own as well.
    Any thoughts ?
    Mark

    Seems like I have found the solution.
    In the taskflow there is a property named data-control-scope and I set it to isolated instead of the default (shared) and this seemed to do the trick.
    I can now have two instances of the same taskflow running with different ApplicationModules
    Cheers,
    Mark

  • Preventing multiple instances of same application - started with "java app"

    I need to ensure that only one instance of an application runs at any given time.
    As far as I know launching it twice with "java appName" will run each in its own memory space, so it is not immediately obvious how to achieve it. I considered using a database entry or environment variable, but those would need to be cleared on exit and therefore be at risk of not being cleared if the application crashes or hangs.
    Is there a Java API call that would allow me to do a check for other instances of the same application... safely?

    Create a ServerSocket on a fixed port number that isn't used by any other application. If you get a BindException, your application is alread running.

  • Stop Multiple Instances of an application

    Hi,
    The title pretty much says it all, I was wondering if I could gather your input on how to correctly stop an application running more than once in java. I have implemented both file locking methods and ServerSockets however both have their disadvantages. For example, the file locking seems to cause a problem that the file is unlocked / deleted if the process is abnormally terminated and I've yet to come up with a solution for this other than creating a batch file to auto run...Similarly, with the ServerSocket it doesn't seem to be very reliable it runs for a few moments and then disappears without an error message...
    I've been searching the web and found something called JUnique which claims to do what I'm after however I'm unsure as to whether it would work the way I'm after as it seems to be implying it works by the file locking method.
    Anyway, how do you go about solving this in your applications?
    Many thanks,
    Barto.
    Ps. The other thing was that I notice that other languages use something called Mutex to stop the running of an application multiple times - is this available in Java?
    Edited by: 799611 on 04-Dec-2010 09:18

    Do you mean the program runs (you can see it in some task manager), but the ServerSocket stops listening (something like netstat -an in Windows confirms this)?
    I belive your program simply completes and it takes the ServerSocket with it, which is just what is expected.
    Your program is dead, so another instance can start.
    Edited by: baftos on Dec 4, 2010 1:23 PM

  • Multiple instances of one application in a single vm

    Hi
    At work we use a database client called SAP, for timesheet, maintenance logs etc.
    To access this application (SAP) we need to use computers on a domain, which we are charged $6000 yearly per. computer.
    To reduce this cost, we want to set up a server running windows server 2012 (for centralized storage, web applications etc), with a virtual machine running windows 7, that is part of the domain, and having access to SAP.
    What we then would need is the ability to remotely log on to the virtual machine and run SAP, easy enough..
    But the problem is that we are 15 people who need to do this at the same time.
    Is this possible? And is Hyper-V the right way to go?
    The server will be running with two network adapters, one for the office network, and one for the virtual machine which connects it with the domain.

    Hyper-V won't allow you to get out of paying your per use licensing.
    You will need 15 licenses of Windows installed in Hyper-V as well as SAP.

  • Multiple Instance of Web Application having static reference

    Hi All,
    I have a Web application "A" and the replicate of the same
    as "B". So it means it has same package and class name,
    for example
    com.test.Util is the java file which gets the DB Properties
    from a File. All the variables in that java file are static
    for example the
    DIRECTORY_NAME = c:/instance1
    FILE_NAME = db.properties
    In application "A"'s web.xml, on load startup i am invoking
    a Servlet on the init method i am grabbing these details
    from my util class.
    In Application "B" i am chaning the com.test.Util
    DIRECTORY_NAME=c:/instance2
    FILE_NAME=db2.properties
    I generate a WAR for Application "A" and "B" and deploy that in Tomcat.
    Now if i start tomcat, i understand that Configuration of
    B overrides A, because they are all static.
    Basic Question is same Static memory blocks are shared by two different deployed web application, i want to have them seperate how can i do that?
    Thanks in Advance
    Arul

    Try deploying them in different domains... not sure of this though

  • Forms10g - starting multiple instances of an application on the client

    Hello,
    On the client forms10g application A is started
    in a browser window XY.
    If I start another forms10g application B
    (in a browser window named XY) the forms application A
    is REPLACED by application B in the existing browser window XY?
    Forms Application A seems to disappear?
    maybe the call of the forms-applet with always the same
    browser window name is the problem?
    any ideas?

    If you are using the same browser window, then I guess that is the way it is supposed to work. To run two different applications separately, you will have to use two different broser sessions.
    Note: Opening a new window using 'Ctrl+N' or File->New->Window will not work with Forms. You need to start a new broswer freshly.

  • Use of Multiple instances of the same browser...

    Hi folks,
    I have a question...
    I have inherited a large APEX application, it uses Oracle SSO to log in.
    We are migrating the application to a new set of servers and are running regression tests.
    The testers are logging in using IE6 and opening multiple instances of the application at the same time on both the oldTest and newTest servers.
    So at any one time, there can be:an application Admin user (username ADMINTEST123)  logged into the application on oldTest
    an application Admin user (username ADMINTEST123)  logged into the application on newTest
    an application standard user (username TEST123)  logged into the application on oldTest
    an application standard user (username TEST123)  logged into the application on newTestIs this supported?
    Could someone tell me or point me toward the documentation or thread that lists what is supported / unsupported for browser use with APEX and SSO?
    Thanks in advance,
    Gus..

    Hi lev,
    thanks but sorry, that doesn't really help me, I'm talking about users and their logins, not developers using different browsers while developing apex.
    Also, our users are locked down to IE6 for the foreseeable future.
    Hi Scott,
    I found the following quote from this web site http://aranea.zuavra.net/index.php/80/ about Cookie separation in modern browsers
    *4.3. Internet Explorer 6.0*
    Finally, Explorer is the one that introduces an interesting quirk. It too has separate settings per machine users, although it cannot make use of multiple profiles for the same user.
    The interesting thing is the way it handles session cookies. Normally, long term a.k.a. non-session cookies are stored on disk in the user preferences. However, Explorer has a setting called “browse in new process” which, if enabled, forces a new session with each new window. That’s right, this means that every time you open a new Explorer window it opens a separate process, even though the windows belong to the same user! And, in turn, these processes will NOT share their session cookies.
    Note: By “new window” I mean windows started from shortcuts, from Start Menu entries or by calling iexplore.exe directly somehow (from a file manager, for example). Windows started via Control+N or File/New window run in the same process and share session cookies. Also, please note that it’s a lot more likely for users to click their taskbar shortcut when they need a new window than it is to use the File menu or the Control+N shortcut.+
    Furthermore, ever since version 5.0 the setting cannot be changed manually, by the user. It is automatically determined by the browser based on how much RAM the machine has. Anything with at least 32 MB of RAM gets the “one window, one process” behaviour, which nowadays means almost all machines.
    I have tested the *"new window"* opening methods and found that for IE6 there is NO NEW PROCESS started when the user opens a new window in the following 3 ways:
    from an open window, File>New>Window
    from an open window, CTRL+N
    from an open window, right click>Open in New Window
    So from this can I conclude that from what you say and the results above we may get issues if users login and then open new windows in those ways?
    Thanks,
    Gus..

  • Running multiple instances of a service

    ello,
    is it possible (and not "tabooed") to run multiple instances of an application that is designed to be service?
    Im intending to use the Java Service Wrapper to have my app run as a service, but im wondering if it is possible to run multiple instances of my application wrapped in the wrapper.
    What about starting the service using command line arguments?
    This is some details of my scenario:
    Im developing a server that will run without threading - it will read client requests that have been saved by the clients into a database. Thus im going to have an infinite while loop that just keeps reading the db for unprocessed client requests.
    When it is noticed that the load has increased then more than one instance of the server will be necessary.
    if im using the java service wrapper to run my server as a service will it be possible to achieve the above?
    thanks.

    one more thing : if i make any changes in the wrapper.conf xml file for the java service wrapper will the config be automatically loaded?

  • Launchpad showing multiple instances of some apps

    Anyone has the same issue?
    I use external USB HD for Time Machine backups of my Data partition and for daily clones of System partition done by SuperDuper! - Launchpad is showing all instances of applications, not only these in the Applications folder on my Mac, but also some from Application folders on the attached clones - as result I see multiple instances of each application, without indication which one is on the running system and which ones are on the clones.
    After disconnecting the extenal USB HD the duplicates still remain in the Launchpad.
    Any idea how to deal with it?
    Any way to refresh the Launchpad?

    The LaunchPad can be refreshed like this:
    press cmd-shift-g and enter there '~/Library', then navigate to 'Application Support' and open the Folder labeled 'Dock' and move the .db file to the trash and now open the Terminal and enter 'killall Dock'.
    The problem you have is probably coming from your the SuperDuper! clones… so be sure to remove the external HD first.
    enjoy the Lion

  • Mutiple Instances of Custom Application on One Machine

    Background: We have a custom-written PL/SQL application that uses the PL/SQL Gateway. It makes use of two database schemas named ASK and ASKME. The iAS DAD points to ASKME. There are PL/SQL procedures under ASKME that call procedures in ASK, and vice-versa. We have the 8.1.6 database and 9i running on the same box, under different ORACLE_HOME's. Everything works great.
    Problem: We would like the ability to have multiple instances of our application running on one machine, for development purposes. Currently, if we want to have another copy of our software, for a temporary development "sandbox" or whatever, we have had to dedicate an entire machine to it. This can get very costly.
    We can easily create another DAD, etc., for the Application Server side, but the database side is a big problem. We can't simply create another copy under a different schema, since there are two schemas which refer to one another in code.
    We have attempted to create another complete installation of Oracle on the same box, listening on another port, but this seems like a big waste of resources.
    Is there a better way?

    Technically, yes.
    I won't get into the debate about whether you should run dev and production on the same box, I will stick with what your question specifically asks, and the answer is yes. You can even run two of what we call Master Instances.
    When you run the installer just be sure to give each instance a different instance id/name. Then you can access the web sites with something like this:
    http://myserver/production
    and
    http://myserver/dev
    It is very common to see a development and QA server on the same machine, and this kind of install is done very often with multiple development servers running on the same box. So, strictly speaking, you can abosolutely do this.
    -Jason Stortz
    http://www.corecontentonly.com

Maybe you are looking for