7 Replies Latest reply on Sep 11, 2018 5:16 AM by emiliep89320758

    Cannot save document "treatment in progress in database"

    emiliep89320758 Level 1

      Hello,

      I have a problem with my scripts that appeared recently in CC2018.

      I do several actions on my active document and then I'm trying to save it.

      This action throws an error "Impossible de sauvegarder le document, des traitements sont en cours dans la base de données. "

      And after that, I'm not able to save my document anymore. I have to close InDesign to make it works again !

       

      Does anyone know why this error appears and how to deal with that ?

        • 2. Re: Cannot save document "treatment in progress in database"
          emiliep89320758 Level 1

          Thanks for your answer. I did this for me and it works. But I cannot say users to do this ... I'm trying to find a way to correct that by script or avoid this case... Because it can happens anywhere in scripts and as a result the document isn't in a stable state.

           

          Users' preferences cannot be reset everytime this happen.

          • 3. Re: Cannot save document "treatment in progress in database"
            Trevorׅ Adobe Community Professional

            If you script is causing the problem then you have to worry about it otherwise you don't.

            The likelihood is that your script is not causing the problem so you can relax.

            If your script is causing the problem then post it here as that would be very interesting.

            • 4. Re: Cannot save document "treatment in progress in database"
              Laubender Adobe Community Professional & MVP

              Hi Emilie,

              I'm not exactly sure what the error message means.

              To clarify this in English could you check the following with the ESTK and InDesign:

               

              var s = "The exact error message here in French." // No additional blank
              app.findKeyStrings(s);
              

               

              An English error string should show in the ESTK's JavaScript Console.

               

              FWIW: Maybe the cause of the problem is/was on your local machine?

              Will not help perhaps, but did you try a try/catch for the said action to avoid freezing the app?

               

              Could you single out some code that will enforce the error?
              Can you post it here?

               

              Regards,
              Uwe

              • 5. Re: Cannot save document "treatment in progress in database"
                emiliep89320758 Level 1

                Hi,

                 

                Sorry I couldn't answer for a while.
                The result for findKeyStrings is :

                "$ID/kCantSaveDocumentWithOpenTransactionError"
                

                 

                The cause of the problem isn't on my local machine. In fact testers have the same problem.

                 

                 

                Context :

                • We have an InDesign's extension (cep/html extension).
                • This extension calls few jsx scripts to do few actions on document (like update links, and so on)
                • At the end, we are saving document with a jsx script
                • All calls to jsx scripts are in a AngularJs promise like this :

                 

                $q.when()
                  .then(function() {
                    //Do some stuff
                  })
                  .then(function(response) {
                    inddPath = response || inddPath;
                    return CSInterfaceService.evalCSHostScript('getDocumentIDVersion', [inddPath]);
                  })
                  .then(function() {
                    return CSInterfaceService.evalCSHostScript('openDocument', [inddPath], "Open document");
                  })
                  .then(function() {
                    //Other calls to evalCSHostScript (each one is a then function)
                  })
                  .then(function() {
                    return CSInterfaceService.evalCSHostScript('saveDocument', [inddPath], "Save document");
                  })
                  .then(function() {
                     //Do stuff on angular model
                  })
                  .then(function() {
                    d.resolve();
                  })
                  .catch(function(err) {
                    //Log errors
                    d.reject();
                  })
                

                 

                Where my function CSInterfaceService.evalCSHostScript is like this :

                 

                function evalCSHostScript(command, args, undoName) {
                   //do some stuff
                   return $q(function(resolve, reject) {
                     csInterface.evalScript(script, resolve);
                   }).then(function (csr) {
                     csr = JSON.parse(csr);
                     if(csr.code > 0) throw csr;
                     Logger.debug("<< evalCSHostScript " + command + " ", csr);
                     return csr;
                   });
                }
                

                 

                 

                It worked well for a while, and since some days it crashes sometimes.
                I think I didn't update my jsx scripts.
                It seems that sometimes, JSX script for saving document is called whereas another action isn't finished (if I understand the error message).

                 

                Regards

                • 6. Re: Cannot save document "treatment in progress in database"
                  Laubender Adobe Community Professional & MVP

                  Hi Emilie,

                  should someone ( Trevorׅ  ) move this thread over to:

                  Extensions / Add-ons Development ?

                   

                  Regards,
                  Uwe

                  • 7. Re: Cannot save document "treatment in progress in database"
                    emiliep89320758 Level 1

                    Hi,

                     

                    I solved my issue.
                    Thanks all for your answers !

                     

                     

                    My problem was linked with an event listener/handler. It was doing some jobs at an unexpected moment during my sequence.

                     

                    As a result, my ending script was trying to save the document whereas event handler was still doing its job.

                     

                    Regards