Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sychronize across JVM's

 
Mohammad Jaber
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

how can i sychronize a certain code among JVM's levels , on other word i have a Clustered Env. and i want to make sure that a pice of code to be executed Synch. at a time amoung all of the Clustered JVM's ...

Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds slightly counterintuitive. What have you included in your architecture that requires synchronization?
 
Mohammad Jaber
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well , i have an ID's generation table on my DB , that is resposible of generating the ID's of my entities according to some Custom rules , this process requires read and write to that table , so synchronization should be garanteed , Thanks
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Database transactions and locks should do this for you. They're generally great at concurrency if you get the options right.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let the database handle that if possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic