• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

B&S - Record handling

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Im new to this board so excuse me if I dont explain
myself clearly.

My system will utilise RMI for networking and allows multiple instances
of the Data access class to occurr. This means multiple threads can
be attempting to alter the DB file at the same time.
Using NIO package and FileChannels they guarantee safety with multiple concurrent threads in same application but if the user runs more than one local application in non networked mode a consistent view of the file is not guaranteed. How do you get round this?
Ive thought about limiting the number of application versions running locally on same machine by having a flag in App properties file and checking the flag before running the application.

Java quote below.

The view of a file provided by an instance of this class is guaranteed to be consistent with other views of the same file provided by other instances in the same program. The view provided by an instance of this class may or may not, however, be consistent with the views seen by other concurrently-running programs due to caching performed by the underlying operating system and delays induced by network-filesystem protocols. This is true regardless of the language in which these other programs are written, and whether they are running on the same machine or on some other machine. The exact nature of any such inconsistencies are system-dependent and are therefore unspecified.



OOOOPS sorry - The old read the instructions properly.

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.



hope I didnt waste anyones time.

Troy

[ March 30, 2005: Message edited by: Troy Farrell ]
[ March 30, 2005: Message edited by: Troy Farrell ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic