Same JVM multiple processes?

Summary: Does any one know how to get a JVM to be shared across different Windows processes, as follows:
Context: I have created a Java ActiveX component. This is instantiated and used as an object embedded in HTML. The HTML will always be executed in Internet Explorer. When I have multiple windows open in the same Internet Explorer process with the same HTML code the static variables are shared by all the Java ActiveX components. If I have multiple process of Internet Explorer open each with the same HTML code the static variables are not shared because different instances of the JVM are running in each Internet Explorer process.
Question: Is it possible to do any of the following:
- Get multiple instances of the JVM to run as multiple Threads i.e. not as separate processed with separate memory segments?
- Get multiple instances of the JVM to share variables?
- Prevent multiple instances of the JVM being created so that all Java objects run in the same JVM regardless of the process that instantiated them.
This is possible in C++ ActiveX components using shared segments across different Internet Explorer processes, as follows:
// in DLL .cpp file
#pragma data_seg (�.mydata�)
int sharedVariable = 1;
#pragma data_seg ( )
#pragma comment(linker, �/SECTION:.mydata, RWS�)Therefore I would expect that if I could achieve a similar approach with Java this would not be prevented by the OS (i.e. Windows) due to memory faults, etc. I know that Java has different (less) memory handling capabilites so this may not be possible but any suggestions would be very much appreciated.
Thanks,
J

Summary: Does any one know how to get a JVM to
be shared across different Windows processes, as
follows:
Context: I have created a Java ActiveX
component. This is instantiated and used as an
object embedded in HTML. The HTML will always be
executed in Internet Explorer. When I have multiple
windows open in the same Internet Explorer process
with the same HTML code the static variables are
shared by all the Java ActiveX components. If I have
multiple process of Internet Explorer open each with
the same HTML code the static variables are not
shared because different instances of the JVM are
running in each Internet Explorer process.
Question: Is it possible to do any of the
following:
- Get multiple instances of the JVM to run as
s multiple Threads i.e. not as separate processed
with separate memory segments? No, each instance of the VM is a seperate process. The closest you can come without hacking the VM and/or IE, is running multiple Java programs in the same VM, each in its own thread.
- Get multiple instances of the JVM to share
e variables?
- Prevent multiple instances of the JVM being
g created so that all Java objects run in the same
JVM regardless of the process that instantiated them.
RMI provides some means of inter-VM communication, but this is probably not suitable for your application. The combination of JNI + NIO also provide some capability for the VM to share memory with native processes, but its not immediately obvious to me how to extend this capability to multiple VM's.
>
This is possible in C++ ActiveX components using
shared segments across different Internet Explorer
processes, as follows:
// in DLL .cpp file
#pragma data_seg (�.mydata�)
int sharedVariable = 1;
#pragma data_seg ( )
#pragma comment(linker, �/SECTION:.mydata,
RWS�)Therefore I would expect that if I could achieve a
similar approach with Java this would not be
prevented by the OS (i.e. Windows) due to memory
faults, etc. I know that Java has different (less)
memory handling capabilites so this may not be
possible but any suggestions would be very much
appreciated.
Thanks,
JAlso, you may want to keep in mind that VM's that run in a browser have a SecurityManager installed that restricts them from performing certain restricted operations. For this reason it may be difficult to do anything really ambitious with an applet or, presumably, a Java ActiveX control, though I have no idea what that is.
Good luck.

Similar Messages

  • Same JVM for multiple Frames in a web application

    Hi guys,
    I have a web application that loads an applet during login. Once the login is completed, the web application will display the available functions accessible with a menu on the left frame and the main display page on the right frame. Whenever any form action is perfomed on the right frame, the jvm with the login session seems to exit (java console closes) and the applet will be loaded to prompt the user to login again. The JRE installed on the Windows client is 1.6.0_14 from SUN.
    I'm guessing that the different frames are using different JVMs?
    Is there a way to use the same jvm for a web application with multiple frames? I want to prevent the case where the user will have to login again.
    Thanks for any advice!
    - Zen -

    I have sort of the same problem
    [Identical applets in the same JVM, next generation plugin issue|http://forums.sun.com/thread.jspa?threadID=5396118]
    I have submitted a Request for enhancement to SUN to allow forced grouping of applets in the same JVM.
    Sort of the opposite of the "separate_jvm" Applet tag parameter.
    It seems there is currently no way to do this.
    [New Plugin command line args|https://jdk6.dev.java.net/plugin2/jnlp/#COMMAND_LINE_ARGS]
    When per-applet JVM command-line arguments are specified, it is likely that the new Java Plug-In will need to launch another JVM instance in order to satisfy them. In other words, it is unlikely that a preexisting JVM instance will have been started with the correct set of command-line arguments to satisfy the current applet's request. The rules for exactly when a new JVM instance is launched to start a given applet are deliberately left unspecified, as this functionality is brand new in the 6u10 release and may need to change in subsequent releases. Here is a rough set of guidelines for the sharing and creation of new JVM instances:
    * If the command-line arguments used to start a preexisting JVM instance are a superset of the requested arguments, the preexisting JVM instance will be used.
    * If a JVM instance is launched for the "default" set of command-line arguments (i.e., those specified in the Java Control Panel, with no per-applet arguments specified), then this JVM instance will never be used to launch any applet that has even one per-applet command-line argument.
    * -Xmx is handled specially: if a preexisting JVM instance was started with for example -Xmx256m, and a new applet requests -Xmx128m, then new applet will very likely be run in the preexisting JVM instance. In other words, -Xmx specifications are matched with a greater-than-or-equal test.
    There is no way to "name" a JVM instance used to launch a particular applet and "force" subsequent applets into that JVM instance.
    See the section on the separate_jvm parameter to isolate a particular applet in its own JVM instance, separate from all other applets.

  • Connect Multiple Ingrian server in same JVM

    Hi All,
    I have faced an issue where I have to connect multiple Ingrain server depending on some choice in same JVM.However I can able to set one server for jvm by placing the IngrianNAE.jar and IngrianNAE.properties in jre/lib/ext and every things running well, but if I tried to modify the Ingrain properties file during runtime through System.setProperties(), it always  pick the old  value instead the new one. So my question is that whether it is possible to configure  for same JVM or not.
    Thanks & Regards

    Any Inputs...?

  • Running multiple weblogic servers on the same JVM

    Is there a way to make Weblogic 7.0 and Weblogic 5.1 run on the same JVM? If so
    what are the pros and cons?

    I hope you also checked the IPCKEY (and all other identifiers of that kind)
    in your ubbconfig file: they should all be different.
    We have similar configurations running without any major difficulty.
    One catch: very heavy IPC activity (due to errors in the application,
    never because of heavy user load) in one environment sometimes overloads
    the OS, resulting in hung applications in the other environments.
    Regards
    Frank
    "Manoj SASIDHARAN" <[email protected]> wrote:
    >
    Hi Troy,
    Here are a few tips:
    1. Check the APPDIR values in both environments. They should point to
    the appropriate
    directories containing the Tuxedo server binaries for each environment.
    Analyse
    the values of APPDIR environment variable and also inside the UBBCONFIG
    file.
    2. Check the WSL address. Both environments should have different ports
    for listening
    to requests.
    3. Check the WSNADDR environment variable at the client side. They should
    point
    to the appropriate WSL addresses.
    HTH
    regards
    MS

  • Target Vs Acual Cost Comparison for multiple process orders

    Dear SAPians,
    I want to take a report for target vs actual cost for all process orders and product cost collectors created in a particular period. I have checked the standard report KKBC_ORD that serve my purpose but for a single order. I want the same report for multiple process orders and product cost collectors.
    Is there any standard report or should I create a report painter report. I have tried to create a report painter report based on library 7KO, but target cost was not showing for selected order.
    Kindly suggest.
    Shirazi

    Target Costs are available in library 601 for internal orders (and can be used for process/production orders).
    Regards,
    Adrian

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment.
    I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer signs up for the service, I make a copy of this
    master database (using SMO) that will now be the database containing all of the customer's information. The database is rather large, and the copy operation can take a couple minutes.
    Everything works fine as expected, unless I try to provision two new customers at the same time. It appears that Azure only allows for one DB copy operation at a time. Is there a way to allow for copying the same database multiple times simultaneously?
    Thanks for you input. I understand that this is likely not the optimal setup, and that there is many better ways of doing this, but I am somewhat heavily invested in the current process and I would like to find out how to make it work if I can.

    BTW, you can do this programatically by using PowerShell (https://msdn.microsoft.com/en-us/library/ee210569.aspx), SqlPackage (http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/)
    or the SQL Server binaries for .NET (http://www.vijayt.com/Post/Deploying-a-data-tier-application-in-SQL-Azure-programatically)
    Hope this helps.
    Alex

  • Multiple processes accessing a replicated database

    Hi
    I am after some help with multiple processes and replicated databases.
    I have a primary and secondary database replicated across a pair of servers and this seems to be working well. I'm trying to run another process on one of the machines that opens the environment and databases to view and/or modify the data.
    The problem is that when I run this process it causes some sort of corruption such that the server process on the same box gets a DB_EVENT_PANIC the next time it accesses the database. I would like to understand what I am doing wrong.
    The servers and standalone process all use the same code to open and close the environment and databases (see below). Just calling
         open_env();
         open_databases();
         close_databases();
         close_env();
    in the utility process causes DB_EVENT_PANIC in the server process.
    Can anybody spot what I am doing wrong? I am using DB Version 4.7
    Thanks
    Ashley
    open_env() {
    db_env_create(&dbenv, 0);
    dbenv->app_private = &my_app_data;
    dbenv->set_event_notify(dbenv, event_callback);
    dbenv->rep_set_limit(dbenv, 0, REPLIMIT);
    dbenv->set_flags(dbenv, DB_AUTO_COMMIT | DB_TXN_NOSYNC, 1);
    dbenv->set_lk_detect(dbenv, DB_LOCK_DEFAULT)
    int flags = DB_CREATE | DB_INIT_LOCK |
              DB_INIT_LOG | DB_INIT_MPOOL |
              DB_INIT_TXN | DB_RECOVER | DB_THREAD;
    flags |= DB_INIT_REP;
    dbenv->repmgr_set_local_site(dbenv, listen_host, port, 0);
    dbenv->rep_set_priority(dbenv, 100);
    dbenv->repmgr_set_ack_policy(dbenv, DB_REPMGR_ACKS_ONE);
    for (x = 0; x < num_peers; x++) {
    dbenv->repmgr_add_remote_site(dbenv, peers[x].name, peers[x].port, &peers[x].eid, 0);
    dbenv->rep_set_nsites(dbenv, num_peers + 1);
    dbenv->open(dbenv, ".", flags, S_IRUSR | S_IWUSR);
    dbenv->repmgr_start(dbenv, 3, DB_REP_ELECTION);
    sleep(SLEEPTIME);
    close_env() {
    dbenv_p->txn_checkpoint(dbenv_p, 0, 0, 0);
    dbenv_p->close(dbenv_p, 0);
    open_databases() {
    db_create(&dbp, dbenv_p, 0)
    flags = 0;
    if (app_data->is_master)
    flags |= DB_CREATE;
    dbp->open(dbp, NULL, "primary", NULL, DB_HASH, flags, 0);
    ... Wait for db if slave and ENOENT ...
    primary = dbp;
    dbp->open(dbp, NULL, "secondary", NULL, DB_BTREE, flags, 0);
    ... Wait for db if slave and ENOENT
    secondary = dbp;
    while (app_data->client_sync) {
    sleep(SLEEPTIME);
    close_databases() {
         secondary->close(secondary, 0);
         primary->close(primary, 0);
         dbenv_p->txn_checkpoint(dbenv_p, 0, 0, 0);
    }

    Running recovery (DB_RECOVER flag to env->open()) must be done only in the first process to open the environment.
    This is a general rule of Berkeley DB, not specific to replication. You can read more about it in the Reference Guide, on the page entitled "Architecting Transactional Data Store applications".

  • Launching Multiple Processes With JWS

    Is it possible to launch multiple processes with JWS? I'd like to specify in the jnlp 2 applications to run. Each application must run in its own java.exe process. Why you ask?
    I've created a mission critical application in JWS that requires the application to be active at all times. If the application crashes, the second application detects the crash and restarts the jnlp.
    How can this be accomplished? I'd like to stay away from created another JVM via JNI if possible.

    billmanhillman wrote:
    Invoking javaws from the application URL is not scalable. LOL! When people talk about 'scalable' they are usually referring to numbers of the order of '2000', not '2'.
    To cover something mentioned in another reply..
    Can you get the path to the jar by getResource()?Nope. Sun considers it not to be the business of apps., to know the location of the classes on disk. They have gone to considerable trouble to make it unavailable to applications.

  • Implement Process order if there are multiple processes in production of FP

    Hi Experts,
    I have another scenario in which for a production of final product i need to go through
    multiple processes.
    For Eg.
    I have a raw product suppose as rubber and i want to make an Tyre
    for which i have to do 3 procedures followed one by the other in sequence
    So can u please explain me how can i achieve the same.
    Thanking you
    Regards,
    Ashish P.
    Edited by: Ashish@123 on Nov 14, 2011 2:06 PM

    ") expected" means exactly what it says. You must be missing brackets there. Correct those and you will prpbably find that the "Illegal start of expressions" will go away too.
    Rachel

  • Multiple processes in the workflow

    Hello Everyone.
    Why do we require multiple Processes in a single Workflow? I see that in the seeded workflows, if i open a process, in the flow there will be another process which again might contain several different process attached to the same flow.
    In realtime when do we require to use this functionality?
    Thanks

    It is not a requirement - it is simply a way of modularizing - just like how any piece of code can call other pieces of nested codes.
    Srini

  • Loading same ELF multiple times

    Hello,
    is it possible to load the same Executable Load File to card multiple times, to different Supplementary Security Domains?
    I tried it with JCOP31 card I have, but INSTALL for LOAD returns 69 85, Conditions of use not satisfied. Is this expected behaviour, ie. is loading same ELF to different SSDs not supported?
    It seems like isolation breach - each SSD should be able to contain whatever it wants as long as applet AIDs don't collide, but Get Status doesn't contain anything about SSD for ELFs nor does Install for Install.
    Or is there some other recommended solution?

    Why do you want multiple copies of your CAP file? You can instantiate an applet multiple times from the one CAP file. Also remember that there is only one JVM on the card as well and the classloader is not like a standard JVM. A CAP file represents a package so you are trying to load the same package into a JVM multiple times in the same classloader. This would also cause issues in Java (not just Java Card).
    Cheers,
    Shane

  • Multiple processes on unix server even stop replicat, is that block port?

    I have configured on source server Oracle goldengate manager/extract on port 7809 and same configured on target server with port 7809.
    Now over the weekend, I encountered two problems.
    1). tcp ip timeout from extract error log and extract abend.
    test : telnet linuxserver 7809
    $ telnet linuxserver 7809
    Trying...
    Connected to linuxserver.
    Escape character is '^]'.
    Connection closed.
    It connected, then after a second, connection closed.
    2). On target server, there are multiple processes for replicat existed even I stopped replicat and stopped manager. There are nothing running.
    ps -ef|grep ggs
    oracle 13595 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14031 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14447 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 14674 1335 0 13:34 pts/0 00:00:00 grep ggs
    oracle 14962 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 15529 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 28295 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 28751 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    oracle 29158 1 0 May20 ? 00:00:00 ./replicat INITIALDATALOAD -p 7819-12818 -m 7809 PARAMFILE /u01/app/oracle/product/11.2.0/ggs/dirprm/load2.prm REPORTFILE /u01/app/oracle/product/11.2.0/ggs/dirrpt/LOAD2.rpt PROCESSID LOAD2 USESUBDIRS
    I have to manually kill those processes by kill -9 on server.
    How to control this manner?
    thanks.

    I have another quetion, in real life migration, our database have a lot clobs datatype, and logsegments, etc. What is the best practice or advices you can give to me?
    I am probably not the best guy to answer this question.
    Can I create multiple extracts on source and multiple replicat on source?
    Yes.
    Let's say we have 10 application users in the prod database, do I create at least extracts for each schema? then within each schema, I create multiple extracts to based on datatype or others?
    Yes. You can create one Extract/Replicat group per schema. That would help in parallelizing the things.

  • Different browser windows share the same JVM

    Hi there !
    Running the same applet in different browser windows
    (Netscape 4.72 - Plug-in 1.2.2) appears to use the same JVM. When I see the process list from the OS (Windows Task Manager) I see only one Netscape Process.
    This is causing me a lot of problems, because the applet opens a socket connection with the server.
    Since all applet instances running in different browser windows each one, are executing on the same JVM, all messages they send to the server goes through the SAME socket connection, turning the server in an inconsistent state.
    Is it possible to start a completly new browser
    process in order to have each applet instance running in a different JVM ?
    TIA for any help

    Not much help for you but I've had the same problem over here ... and we could find nothing to improve this.

  • Multiple processes getting created for weblogic instance.

    multiple process creating for weblogic instance. which lead to slow performance.
    /home/dz84tl> ptree 24524
    1464 zsched
    24524 /usr/bin/ksh /usr/local/bea/wls92/domains/gqts/bin/startWebLogic_gqts001 nodebu
    24547 /usr/local/bea/wls92/jdk150_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRati
    3401 /usr/local/bea/wls92/jdk150_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRati
    It is supposed to be only one child process but there are multiple.

    Hi,
    Nodemanager is not used to start the managed server.
    below is the snnipet:-
    Bgqts 26106 1464 0 May 11 ? 0:00 /usr/bin/ksh/usr/local/bea/wls92/domains/gqts/bin/startWeblogicgqts001_ nodebu
    Bgqts 22800 22799 0 08:51:35 ? 0:01 grep Bgqts
    Bgqts 26125 26106 1 May 11 ? 1004:14 /usr/local/bea/wls92/jdk105_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRati
    Bgqts 13775 26125 0 06:17:03 ? 0:0 /usr/local/bea/wls92/jdk105_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRati
    Bgqts 26646 1464 0 May 11 ? 0:00 /usr/bin/ksh/usr/local/bea/wls92/domains/gqt/sbin/startWeblogic.sh
    Bgqts 26678 26646 0 May 11 ? 9:05 /usr/local/bea/wls92/jdk105_22/bin/java -server -Xms512m -Xmx512m -XX:MaxPermSii
    Bgqts 24187 26125 0 11:20:32 ? 0:00 /usr/local/bea/wls92/jdk105_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRatii
    Bgqts 14710 26125 0 8:13:19 ? 0:00 /usr/local/bea/wls92/jdk105_22/bin/java -server -Xms1024m -Xmx1024m -XX:NewRati
    As I understood there is some time gap between this process creation.also we can see here even after using startWeblogic.sh instances are getting created.
    There are other two domains but in those domains this problem is not seen. only gqts domain has this issue.also in other two domains the same script is used.
    Really not getting what can be the reason behind this process creation.
    Does it mean startWeblogic.sh is creating processes?
    or the application which are deployed on managed servers are responsible for it?
    Thanks in Advance.

  • BOM Explosion for Multiple Process Orders

    Hi,
    I hope someone can assist me with the following: Is there a report I can run or transaction I can do to have BOM explosion for multiple Process Orders? I would like to input process orders for a week and see the BOM details per PO.
    Thanks

    Dear Sukendar,
    1.For this requirement you have to go for a Z report and you can give the Functional Spec's to prepare
    this report to your ABAP consultant.Prepare the input format,logic of the program and the output format.
    In the logic part you can make use of this Functional Modules's CSAP_MAT_BOM_READ or 
    CSEP_MAT_BOM_READ  or CS_BOM_EXPLOSION   or CS_BOM_EXPL_MAT_V2 .
    2.Using CEWB helps you to identify all the material that's having the BOM,but here the report does not
    shows you the level by level by BOM for a FERT.
    Check and revert back.
    Regards
    Mangalraj.S

Maybe you are looking for

  • Error in setting up HTTP Header Variable Authentication

    Hi, I am trying to set-up SSO for SAP Biller Direct aplication (deployed on SAP J2EE 7.0) using HTTP Header variable authentication. As per SAP documentation I have created a new login module "HeaderVariableLoginModule" pointing to class "com.sap.sec

  • TS1538 Error message when connecting iPod Touch :iTunes could not connect to this iPod. An unknown error occured. 0xE

    This is the error message I get whenever I try to connect to itunes with my iPod touch or iPhone 4.

  • Purch.Req for STO

    Dear Experts... 1. Can we have a Purchase Requisition for the STO? Our client based in Kochin has branches in other states like Delhi, Kolkata,       Andhra etc..the sales requirement data collected from branches will be sent to Kochi head office, an

  • Where can I get a USB cord for a 2620?

    Just bought a 2620 from an online auction and when I got it there wasn't a USB cable. Didn't know it didn't come with one! Does it take a special kind of USB cable? The one for my old printer was made just for that printer (plug in to printer was jus

  • Indesign CS6 Crashes on start up

    My Indesign crash on the start up. Once started it quits unexpectedly. I never get any tool bars or anything just before that stage it quits. I've reset my home directory permissions and acls but it still doesn't work. Any ideas?