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

    Delete DB file with persistence lib

    phiphou Community Member

      Hi,

       

      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 ?

       

      Thanks

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

          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
            promanens Community Member

            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.

             

            Pascal

            • 3. Re: Delete DB file with persistence lib
              phiphou Community Member

              Pascal,

               

              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.

               

              Thanks