6 Replies Latest reply on Nov 29, 2018 4:49 PM by rp0428

    Warning when one developer overwrites the code of another developer

    Barabum

      I installed 18.2.0.183 version of SQL Developer.

       

      If I am not mistaken, several years ago SQL Developer warns when one developer overwrites the code of another developer.

      Now I cannot reproduce this warning message. Tried to edit same package from two instances of SQL Developer simultaneously and successfully overwrote each other changes.

      Is this functionality switched off in the last versions?

       

      I think some simple optimistic locking mechanism for PL/SQL packages, procedures etc. make sense irrespective if developers use version control system or not

       

      Thanks and sorry if the question is stupid

        • 1. Re: Warning when one developer overwrites the code of another developer

          If I am not mistaken, several years ago SQL Developer warns when one developer overwrites the code of another developer.

          What does 'code of another developer' mean to you.

           

          The only code sql developer might overwrite is the code in the database. That code does NOT belong to a 'developer'.

           

          If one developer has code on their machine and another dev modifies the code in the database sql dev is NOT going to 'overwrite' the first users code that is on their machine. Sql dev being used by the second dev won't be able to access other pc's unless you map their drives to each other.

           

          That said - once code exists in the DB then ANY dev from ANYWHERE using ANY version of Sql Dev that edits the DB code is obviously going to modify it - so why would any 'warning' be needed.

           

          Please explain more thoroughly what your concern is and provide a SPECIFIC example.

          • 2. Re: Warning when one developer overwrites the code of another developer
            Barabum

            rp0428, thank you for answering and sorry for rather vague question!

             

            SPECIFIC example is as follows:

             

            1. Developer A opens package C.PKG body in SQL Developer (C is schema name)

            2. Developer B opens package C.PKG body in another SQL Developer

            3. Developer A makes some changes in package C.PKG body

            4. Developer B makes some other changes in package C.PKG body

            5. Developer A compiles package C.PKG body, closes SQL Developer and goes to lunch

            6. Developer B compiles package C.PKG body

             

            So, changes from Developer A are lost. I think on step 6 better to warn Developer B, that package has changed.

            I have a feeling, that this functionality existed in SQL Developer several years ago.

            • 3. Re: Warning when one developer overwrites the code of another developer

              SPECIFIC example is as follows:

              Sorry - but that example violates best practices.

               

              Developers should NOT be accessing a common app schema as you describe.

               

              The usual, common practice is:

               

              1. all 'official' code is kept in a version control system

              2. an application exists in its own schema

              3. each dev should do their dev work in their own schema and NOT in the app schema

              4. once a dev develops and tests new/modified code for the app they should check it into version control

              5. a designated dev/dba then perioidically (one or twice a day, or as needed) updates the app schema with changes by checking the changes out of version control and applying them to the app schema

               

              When you use the above process the 'problem' you describe simply doesn't exist.

               

              So you are, essentially, asking the sql dev team to spend time and resources to address an issue that is totally under your control and won't even happen if you develop using best practices.

               

              Doesn't sound like a very good use of limited resources to me. Would you spend your own money on this if sql dev was your product? Or would you instead spend it on adding new features that are really needed?

               

              You can post your suggestion on the Sql Developer exchange and see what support you get for it. While reviewing the exchange check out some of the other features and enhancements people have suggested.

              1 person found this helpful
              • 4. Re: Warning when one developer overwrites the code of another developer
                Barabum

                I totally agree with you!

                But what will you do if you need to develop as fast as possible rather small demo project, which will never become a production system?

                 

                My question is about existed some time ago feature of SQL Developer which seemed to be removed from it. I even found mention of this feature here:

                "Afaik Oracle SQL developer can inform you that the code that you have open, has been changed."

                https://community.oracle.com/message/12884683#12884683

                 

                Is it really so?

                • 5. Re: Warning when one developer overwrites the code of another developer
                  Mike Kutz

                  Barabum wrote:

                   

                  I totally agree with you!

                  But what will you do if you need to develop as fast as possible rather small demo project, which will never become a production system?

                   

                  My question is about existed some time ago feature of SQL Developer which seemed to be removed from it. I even found mention of this feature here:

                  "Afaik Oracle SQL developer can inform you that the code that you have open, has been changed."

                  https://community.oracle.com/message/12884683#12884683

                   

                  Is it really so?

                  It is probably an option somewhere that allows you to abort,retry, or ignore when "code changed detected".  I'd have to do some testing to verify.

                   

                  I do like Sven's idea of using EBR to keep each developers "Edition" separate.  (You'd still need to use a Code Repository to handle the MERGE/PULL REQUEST)

                   

                  SQL*Developer needs some work in this area in order for developers to easily take advantage of it.  (SQL*Developer Exchange https://apex.oracle.com/pls/apex/f?p=43135:1 )

                  https://apex.oracle.com/pls/apex/f?p=43135:7:::NO:RP,7:P7_ID:40601

                  https://apex.oracle.com/pls/apex/f?p=43135:7:::NO:RP,7:P7_ID:40581

                   

                  My $0.02

                   

                  MK

                  • 6. Re: Warning when one developer overwrites the code of another developer

                    But what will you do if you need to develop as fast as possible rather small demo project, which will never become a production system?

                    You do what I told you to do in my last reply.

                     

                    1. create/prototype it in your own schema

                    2. test it

                    3. demo it

                     

                    None of what you just said appears to involved anyone other than you.

                     

                    It it does involve others then you create a new APP_DEMO schema to hold the official objects and follow the process I outlined.

                     

                    How does 'fast as possible' change anything?  It is much faster to do it the way I outlined than to try to UNDO the damage caused when developers, even accidentally, write over each other's changes.

                     

                    What you can't afford mistakes you need to use the process I mentioned to keep mistakes from happening.

                     

                    Not recommended but you can allow any/all of your demo developers to do the checkout/update app schema thing. But just following that process, even if everyone is doing it rather than just one designated person, will still keep the accidents from happening.

                     

                    That is because when you CHECK OUT the official code from version control that code is LOCKED so that another developer can NOT check it out and make changes. They can COPY it out and make changes for the work in their own schema but they can't then check it back in as the official version until the original lock is removed.

                    My question is about existed some time ago feature of SQL Developer which seemed to be removed from it. I even found mention of this feature here:

                    "Afaik Oracle SQL developer can inform you that the code that you have open, has been changed."

                    https://community.oracle.com/message/12884683#12884683

                    Did you notice these things?

                     

                    1. that was three years ago

                    2. EVERY SINGLE REPLY (including mine at the end) said the same thing I told you in this thread

                    3. the 'Afaik' is just what that responder thinks - there is NOTHING to support it.

                     

                    The last change date in the database isn't reliable since code can become invalid when dependent objects get modified and Oracle will implicitly recompile it. So even if that date changes it doesn't mean the code itself has really changed. But, of course, it could have.