This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronization problem  RSS feed

 
sigamala viswanath
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some question regarding the synchronization i.e.
A couple as join account in the some xyz bank and many cases like both accesses the account at the same time.
Bank application is executed in two or more JVMS and as I know for each JVM single object created for servlet.

My question is if suppose two thread i.e. one thread for one JVM (Husband transaction) and other thread for another JVM (wife Transaction).

Above how can I make threads to be synchronization?

Hope my question is clear.

Thanks,
Viswanath S
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread synchronization uses a common object as a lock. And, there is no way to have the same object in two different JVMs.

In cases like this, clients either make remote connections to the same service to coordinate transactions, or use a database.

Henry
[ April 21, 2006: Message edited by: Henry Wong ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!