Menu

#11 prevent multiple instances of programm

Not scheduled
rejected
5
2018-12-14
2007-01-05
Anonymous
No

i feel that multiple open instances of the program can lead to confusion, so i better do not do that. But what if it happens inadvertently? I might change an entry in one instance and overwrite it later by another. Could this secenario even corrupt the data file?

Would it be a good idea to use some kind of lock to prevent multiple instances of JPassword accessing the same data file?

Discussion

  • Wolfgang Keller

    Wolfgang Keller - 2007-01-05

    Logged In: YES
    user_id=551242
    Originator: NO

    Some people do feel that multiple open instances are good for comparing different files! :)

    First, I must confess I currently lack the knowledge if and how this can be done in pure Java (namely to prevent multiple running instances of the same program). Second, at this time I'm not perfectly convinced this is a good idea.

    About your concern with multiple "open" databases:

    First, please keep in mind that Java does not make promises about the behaviour of a VM environment, in particular concerning OS dependent blocking and sharing. But assuming reasonable and expectable behaviour here, I can say the following.

    A. There is no reason to fear database corruption from multiple open instances/files. This is because JPWS does not keep open (random access) database files! So the only critical phase is when a file is actually being saved. During this stream writing phase the OS has automatically locked the file against secondary open requests, so there should be no corruption possible from this side.

    B. If you have the same file open in two different instances of the program, modify and save in both instances, the content of the instance that has saved latest is the actual file content.

    Presently, yes, JPWS expects the user to keep some awareness of what he or she is doing. Also, this program is designed as a *personal* manager, not a multi-user application. I consider to add file locking on an optional basis though some day. This would prevent simultaneous opening of the same file (in an environment that supports this kind of file locking). Yet, I don't see it as urgent.

    Cheers!
    - Wolfgang

     
  • Wolfgang Keller

    Wolfgang Keller - 2007-01-05
    • milestone: --> 536819
    • priority: 5 --> 3
    • assigned_to: nobody --> kse
     
  • Wolfgang Keller

    Wolfgang Keller - 2007-09-01
    • milestone: 536819 --> Somewhen
    • priority: 3 --> 5
     
  • Wolfgang Keller

    Wolfgang Keller - 2007-09-01

    Logged In: YES
    user_id=551242
    Originator: NO

    Should be done when conditions met.

     
  • Wolfgang Keller

    Wolfgang Keller - 2012-06-04

    Note that file locking has been implemented with 0-6-0 RC1, which works with operating systems that support such a feature (e.g. Windows). This will prevent inadvertent conflicts.

     
  • Wolfgang Keller

    Wolfgang Keller - 2018-12-14

    Exclusion of multiple program instance is now deprecated and overriden by the MERGE-ON-CONFLICT feature during file saving, available since version 1.1.

     
  • Wolfgang Keller

    Wolfgang Keller - 2018-12-14
    • labels: Project Policy --> Project Policy, operations
    • status: open --> rejected
    • discussion: enabled --> disabled
    • Group: Future --> Not scheduled