This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

ErSandeep Hooda

Greenhorn
+ Follow
since Aug 11, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ErSandeep Hooda

You know how many JVMs on which your application is deployed. Say you have 4 JVMS
This is how you can divide your work among multiple JVMs.
1. Java program running in each JVM will generate a random no say 51, 40, 33, 42 (4 JVMs so 4 random nos).
2. Each program will enter his random no in DB and wait till all four enters there random no.
3. After all the four random nos are entered in DB the program running on JVM with the least no (33 i.e. JVM 3) will become master and will divide the work and update the DB with the division of work (division of work mean which JVM will process which set of data).
4. Once the master JVM enters the plan All JVM can follow the plan.

Please let me know if this solution fits your problem.

Sandeep Hooda.