4 Replies Latest reply: Aug 20, 2013 4:39 PM by User286067 RSS

    EA4: Saving package spec & body to file overwrites random file

    User286067

      Lately while working on packages, I have noticed, that, when I want to save package spec & body to same file (I have my reasons to do so), I normally click on package name in 'schema Browser', right click and select 'Sace package spec & body ...' option.

      In the file dialog box, I normally navigate to 'Scripts library folder and choose a existing file name, expecting it to be overwritten. 100% of the cases, SQLDEV will write to some other random file and the file name I have selected will NOT be touched at all.

       

      Is this a known issue? This DOESNT happen if I select a new file to write to (non-existent file).

       

      I am running 4.0.0.12.27 on Windows 7 pro (64 bit) with java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

       

      Raj

        • 1. Re: EA4: Saving package spec & body to file overwrites random file
          Vadim Tropashko-Oracle

          Can't reproduce, need step-by-step test case:

          1. Select TEST_PACK package spec node in navigator tree.

          2. Context menu -> "Save Spec and body"

          3. Choose "My Documents" folder, save.

          4. Witness TEST_PACK.sql in "My Documents" folder.

          5. Open TEST_PACK package editor and insert the "/*modified*/" comment anywhere.

          6. Compile.

          7. Context menu -> "Save Spec and body"

          8. Choose "My Documents" folder as before, save.

          9. Open TEST_PACK.sql in "My Documents" folder, and confirm the inserted comment in the text.

          • 2. Re: EA4: Saving package spec & body to file overwrites random file
            User286067

            1. Connect to schema A

            2. Right click on connection, start schema browser

            3. open package_a

            4. Right click on package name in schema browser, select 'Save Package Spec & Body' option

            5. in File dialog, navigate to 'Scripts' folder (which is under 'My documents' for me

            6. Save to a new file package_a.sql

            7. Save is successful to package_a.sql

            8. Modify package body, recompile

            9. Repeat steps 4-5-6, only change select package_a.sql name to overwrite the file with new code

            10. SQLDEV claims save is successful (it says the same thing in 'File - log' tab as well.

            11. Start windows explorer, navigate to 'Scripts' folder, sort files by last modified time descending.

            12. I can see that some other existing file was overwritten because

                 a. it has a timestamp later than 'package_a.sql'

            and

                b. the randomly modified file has the new code for package_a in it, existing package_a is left as is.

             

            Just to reiterate this is on EA4

            HTH

            Raj

            • 3. Re: EA4: Saving package spec & body to file overwrites random file
              Vadim Tropashko-Oracle

              Thank you for the effort. There are still informal steps. Here is refined test:

               

              ...

              7. Save is successful to package_a.sql

               

              ------------------------------------------------

              7a. wait one minute

              7b. copy file package_a.sql with OS command

              7c. witness copy_of_package_a.sql having later timestamp

              7d. edit copy_of_package_a.sql to have easily identifiable content

              ---------------------------------------------------------------------

               

              8. Modify package body, recompile

               

              9. Repeat steps 4-5-6, only change select package_a.sql name to overwrite the file with new code

               

              --------------------------------------------------------------------------------------------

              I don't understand what you are saying here, don't you want to keep fine name and location the same?

              Or you have meant that the first time around you had to input filename, and this time you just have choosen it?

              --------------------------------------------------------------------------------------------

               

              10. SQLDEV claims save is successful (it says the same thing in 'File - log' tab as well.

              11. Start windows explorer, navigate to 'Scripts' folder, sort files by last modified time descending.

              12. I can see that some other existing file was overwritten because

                   a. it has a timestamp later than 'package_a.sql'

              and

                  b. the randomly modified file has the new code for package_a in it, existing package_a is left as is.

               

              --------------------------------------------------------------

              I see intact copy_of_package_a.sql and modified 'package_a.sql


               

              • 4. Re: EA4: Saving package spec & body to file overwrites random file
                User286067

                VadimTropashko wrote:

                I don't understand what you are saying here, don't you want to keep fine name and location the same?

                Or you have meant that the first time around you had to input filename, and this time you just have choosen it?

                 

                First time  I chose a file name that didn't exists, second time, I chose the same file name to overwrite it.

                 

                My observation is, firs time when a file name is chosen (which didn't exists at that point in time), SQLDEV did what it is supposed to do, wrote the file.

                Second time when I requested the file to be overwritten, it randomly picked another file name in the same directory and overwrote it, the filename which I asked SQLDEV to write to, was left untouched.

                 

                My destination directory is what Windows 7 calls a Library, essentially a directory called scripts under 'My documents'.

                 

                Raj