Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The difference between the two connection modes ?

 
Morten Nielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it correct, talking about the two ways the assignment is telling me to inplement the use of the server, that the Network modes must be threadsafe and the local-same-vm-mode doesn't because it is a single-user connection, or am I wrong ??
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local mode does not use the server at all, no RMI in local mode. Think of it as a stand-alone program.
Mark
 
Morten Nielsen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So when I run in the localmode, the connection to the DB doesn't have to be threadsafe, correct ??
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the Data class itself has Synchonized in them, but it won't have any effect to one user.
Mark
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:
Well the Data class itself has Synchonized in them, but it won't have any effect to one user.
Mark

How come this same Data class synchronised methods will be used both for local and network connection? there's no point in having synchronised methods in local mode. right?
I feel that local mode also has to be thread-safe, bcos Data class has synchronised methods.
So in my design, i made sure that irrespective of method of connection, the locking mechanism is thread safe.
Is this fine, and how do i document my views in design.txt?
thanks,
sri
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well in local mode you will not do any locking, since there is no chance that there is any other user locking the record. Because there are no other users.
Mark
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Yes, i understand that, but why then are we using synchronised methods of Data Class,
in local mode?
[ December 05, 2002: Message edited by: Sri Addanki ]
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Mark, can u please help...
 
Quan Battoner
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey.I am a new one .
I think: There is only one user to call the method in the Data class .So Synchonized it or not has no different! I think!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic