4 Replies Latest reply: Dec 16, 2013 11:34 AM by Vadim Tropashko-Oracle RSS

    [4.0]Opening a file automatically connects to a DB

    archimede

      Hi all.

       

      I'm referring to this discussion (now archived).

       

      SQLDeveloper now correctly compiles the files I open against the current active connection (thank you very much for that).

       

      Unfortunately, a new bug has been introduced:

       

      - open SQLDev

      - open conn1

      - open fileA

      - compile fileA

      - close SQLDev

      - open SQLDev

      - open conn2

      - open fileA

       

      At this point SQLDev connects to conn1 (I suppose it somehow remembers the last conn I compiled fileA against).

       

      I really hope I'm missing something obvious, otherwise we're back to square 1, as far as I'm concerned (that is, a behaviour so annoying to render the product practically unusable).

       

      OS X 10.9

      SQLDev 4.0.0.13.80

      Java 1.7.0_21

       

      Alessandro

        • 1. Re: [4.0]Opening a file automatically connects to a DB
          Vadim Tropashko-Oracle

          Yes, pl/sql file is associated with the last connection it has been compiled against. If you want to change this association, then just switch the connection in the dropbox and recompile. The reason why opened connection in the navigator is ignored is because a typical user has more than one connection opened, thus rendering the idea of "default" connection flawed.

          • 2. Re: [4.0]Opening a file automatically connects to a DB
            archimede

            VadimTropashko wrote:

             

            Yes, pl/sql file is associated with the last connection it has been compiled against. If you want to change this association, then just switch the connection in the dropbox and recompile.

            Let's see if I understand correctly.

             

            Before, if I wanted to compile the same file against different connections, I was forced to choose one (even though only ONE was opened).

             

            After the "fix", not only I have to take the same action, but I also have to close a connection that's opened against my wish.

             

            Sorry, that's hardly an improvement in my eyes...

             

            So I have to ask again: can you remove (or make optional) that nasty association?

             

            Alessandro

            • 3. Re: [4.0]Opening a file automatically connects to a DB
              archimede

              In case someone else is facing the same problem, I ended up writing a simple script that, before launching SQLDeveloper, removes

               

              .sqldeveloper/system4.0.0.13.80/o.sqldeveloper.12.2.0.13.80/project.qbql
              

               

              HTH.

               

              Alessandro

              • 4. Re: [4.0]Opening a file automatically connects to a DB
                Vadim Tropashko-Oracle

                The other way around it is to compile the file against two different databases. If file is associated against more than one connection (i.e. there are two records in project.qbql), then the default connection in drop box would be selected from active open connections (but only if there is single one).

                 

                Jeff suggested that if

                Tools > Prefs > Code Editor > Link Stored Procedures to Files

                is unchecked, then the default connection shouldn't be chosen from project.qbql, and I agree to fix that.