3 Replies Latest reply on Jun 17, 2011 4:19 AM by phiphou

    Delete DB file with persistence lib




      For one of my project I need to do this :


      - read a field in a database table

      - make a remote call and compare returned value with the value returned by previous sql statement

      - if not equals, I need to download a new databse file and overwrite the old one.


      Using persistence lib I don't succed in doing this ! It seems that one or more connections are not closed, or maybe a db.begin() without rollback or commit. So I cannot delete the db file one I've make a first request... (file in use, or Error #3119: Database file is currently locked'.)



      Hope you understand my poor english.. Can you please tell me how to do that ?



        • 1. Re: Delete DB file with persistence lib
          phiphou Level 1

          Alex, do I have to open a bug on https://bugs.adobe.com/jira/browse/cgm for that ?


          I tried to fix that by myself but with no success yet...


          While trying to debug, I realized it would be usefull to know more about opened connection.


          I've seen you've made some work on persistence lib these days, and it seems a new release is comming, isn't it ?


          Maybe with some advices I could try to fix it by myself, but I need you to tell me where to have a look.


          Please let me know...

          • 2. Re: Delete DB file with persistence lib

            Hello Phiphou,



            I've looked at your issue  and kept running into the same 3119 error when closing the  SQLConnection. The transactions are commited or rollbacked so it  shouldn't prevent the connection from releasing its lock on the DB file.  I failed to find any useful information regarding this error at the moment. Maybe  someone else from the Cairngorm community can help you.


            I guess your need is for upgrading the version of your application and your remote server  provide you with a fully upgraded DB. Maybe you can address this problem the other way and have your server sends you an upgrade SQL script which you would run against your local DB through the persistence API.



            • 3. Re: Delete DB file with persistence lib
              phiphou Level 1



              You solution could be possible...As I only read a unique field (the db "version"), I could store it in a specific xml or txt file near the app and read it.

              In my context,I could use many solutions, but the bug is still here. There is probably some context in witch you really cannot do it using another solution...


              I'm waiting to Alex, for the bugbase, because I don't want to open an unusefull bug...


              So the bug is not yet fixes, and I'm happy to see that I'm not the only one on it.