• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

The difference between the two connection modes ?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Mark, can u please help...
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Hold that thought. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic