Menu

MDB file locks

Help
Serg
2011-10-31
2012-10-04
  • Serg

    Serg - 2011-10-31

    Does Jackcess support locking MDB files?
    It would be very useful to make shared or exclusive locks on file, e.g.
    methods like this: lock(boolean shared) and unlock() methods

    many thanks for all your work

     
  • James Ahlborn

    James Ahlborn - 2011-10-31

    jackess does not do any file locking currently. why do you want to lock the
    file? are you worried about other users of jackcess, or someone using
    microsoft access on the same mdb file? the reason ask is because i don't
    believe ms access locks the mdb file directly, but instead locks a separate
    file.

     
  • hleofxquotes

    hleofxquotes - 2011-10-31

    For MsMoney file (*.mny), Money created a lock file name fileName.lrd with 1K
    size. The file appears to have additional information such as hostname,
    process name ...

     
  • Serg

    Serg - 2011-11-01

    Yes, the same MDB file may be accessed by other Java processes, MS Access,
    etc. Thus the file may be corrupted if several users try to read/write it.
    How about OS file locks implemented in Java (java.nio.channels.FileLock)? For
    example Jackcess may use a shared lock when reading MDB data and use an
    exclusive lock while writing data... Probably it should be an option
    configured by some method like setLockingEnabled(boolean lockEnabled)...

     
  • James Ahlborn

    James Ahlborn - 2011-11-01

    yes, but locks are only useful if all applications use them. like i said, ms
    access doesn't lock the access db, it uses a separate lock file (access
    creates a file named fileName.ldb with some info like computer and user). so
    locking the mdb file will not help you if you are trying to protect from
    simultaneous edits from ms access.

     

Log in to post a comment.