Menu

Mirror Folder files are not being recreated when Access database is changed by another program

Help
DigitalDan
2015-05-25
2015-06-25
  • DigitalDan

    DigitalDan - 2015-05-25

    The documentation says that if somebody else changes the underlying Access database, the mirror files will be recreated. This appears not to happen for me.

    So I tried an explicit reset by using MirrorFolder instead of KeepMirror. This also appears simply to re-use the existing files.

    The only way I can reset things is to delete the files from the mirror folder by hand. It is somewhat inconvenient to have to remember this.

    Thanks.

     
  • Marco Amadei

    Marco Amadei - 2015-05-26

    Basing on our tests(done at each release and right now), you're wrong, the mirror db is always kept alligned.
    It's unclear the kind of test that exactly you did.

     

    Last edit: Marco Amadei 2015-05-26
  • DigitalDan

    DigitalDan - 2015-05-26

    Thanks for the reply.

    OK, I'll test more carefully, be more detailed about configuration, and report back. But shouldn't changing KeepMirror to MirrorFolder generate a new set of files anyway? Otherwise, why are there two different verbs?

     
  • Marco Amadei

    Marco Amadei - 2015-05-26

    The mirrorFolder parameter forces memory=false and sets the folder where the hsqldb files will be created(the default is the folder where the access database is located).
    The keepMirror parameter gets the hsqldb files kept when the jvm process ends so that they won't be recreated ex-novo at the next connection in a next jvm process. However, should the access database be modified in the meantime, they will be recreated.

     

    Last edit: Marco Amadei 2015-05-26
  • Gord Thompson

    Gord Thompson - 2015-05-27

    Dan: Note also that the mirror files do not get updated immediately after a change is made to the database file by another application. The mirror files are updated ("aligned" with the Access database file) the first time that UCanAccess is actually asked to do something with the database after the external update. That's when UCanAccess "notices" that the Access database has been changed by some other process and updates the mirror files.

     
  • DigitalDan

    DigitalDan - 2015-05-28
    1. A question asked a couple of times but not yet answered: Shouldn't memory=false; mirrorFolder=... recreate the files whether they are there or not? Otherwise, how does it differ from keepMirror once the files exist?

    2. The phenomenon I am seeing is that if there have been any changes to the database, my Java program that accesses it via UCanAccess simply doesn't work. It acts as if it is querying an empty database. And it does not issue the warnings that are always issued when I have deleted the mirror files. This is in a Windows 7 environment on a relatively recent Dell PC. If anyone wants to pursue it, I can try to work up a test case. Otherwise, thanks for the help and I'll continue to zap all the files whenever I change the database content.

     
    • Gord Thompson

      Gord Thompson - 2015-05-28

      re: 1

      mirrorFolder= is for specifying the location of the mirror files when they are not to be persistent. This can be useful when we don't want to keep the mirror files from one session to the next, but we do want to put them in a particular place while they exist (e.g., in a local folder when accessing a database file on a network share). UCanAccess will create the mirror files in (a subfolder of) the specified location and remove them when the connection is closed.

      keepMirror= tells UCanAccess to put the mirror files in a specific location and persist them from one session to the next. This helps reduce startup time if the Access database is relatively large and it has not been modified since the last UCanAccess session ended. If the Access database has been modified then the (existing) mirror files are updated to reflect the current contents of the Access database.

      The intention is to use either mirrorFolder= or keepMirror=. If both are specified, keepMirror= takes precedence.

      If either of those options is specified then memory=false is implied.

      re: 2

      Yes, a test case would be helpful. I am unable to recreate your issue using the latest version of UCanAccess (2.0.9.5).

       

      Last edit: Gord Thompson 2015-05-28
  • DigitalDan

    DigitalDan - 2015-05-28

    Referencing 2. above: the warnings are due to a non-essential linked Excel file that is often not present when I am running this program.

     
  • DigitalDan

    DigitalDan - 2015-05-30

    As I said at the very beginning, I change KeepMirror to MirrorFolder when I want new files. That doesn't happen. In no case do my files ever get deleted by UCanAccess. Maybe it's a permissions problem. I'll check that out.

    Thanks.

     
    • Gord Thompson

      Gord Thompson - 2015-05-30

      Note that mirrorFolder always

      • creates its own subfolder (with a name like "Ucanaccess_net.ucanaccess.jdbc.DBReference@4bfe6b"),

      • puts its mirror files in that subfolder, and then

      • deletes the subfolder when the connection is closed.

      By contrast, keepMirror puts its mirror files directly into the specified location.

      So, if you have existing keepMirror files and you simply change keepMirror to mirrorFolder then the existing keepMirror files will not be deleted because mirrorFolder uses its own separate subfolder.

       

      Last edit: Gord Thompson 2015-05-31
  • DigitalDan

    DigitalDan - 2015-06-02

    Hmmm. I specified a file name for mirrorFolder. The same name, as it happens, as in the previous keepMirror. That is ignored?

     
    • Gord Thompson

      Gord Thompson - 2015-06-02

      The best way for you to fully understand the similarities and differences between the behaviour of mirrorFolder and keepMirror is to see for yourself. Create and run a little test program that opens a connection and then goes to sleep or pauses for console input, then look at the files and folders that were created.

       
  • DigitalDan

    DigitalDan - 2015-06-24

    It is a little hard for me to believe that you think I haven't already done that. I am reasonably certain that my issue is not a failure on my part to understand the intent of these two specifications, but rather, on my system at least, a failure of the package to implement the features as intended. For now, let's let it go at that.

     
  • Marco Amadei

    Marco Amadei - 2015-06-25

    Digit,
    I don't think it's a proper answer(and with a proper timeframe) to a person who was just trying to help you. You likely don't handle properly the connections' closing, and for some reason related to your system, the jvm shutdown hook isn't invoked. This situation will be addressed in ucanaccess 3. A test case would have been more useful, rather than some "how can you think I haven't already done..." .

     

    Last edit: Marco Amadei 2015-06-28

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.