You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Ed Costello (JIRA)" <ji...@apache.org> on 2011/05/18 05:53:47 UTC

[jira] [Created] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
-------------------------------------------------------------------------------

                 Key: DERBY-5239
                 URL: https://issues.apache.org/jira/browse/DERBY-5239
             Project: Derby
          Issue Type: Improvement
          Components: Network Server
    Affects Versions: 10.8.1.2, 10.6.1.0
            Reporter: Ed Costello


The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.

This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.

I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035889#comment-13035889 ] 

Dag H. Wanvik commented on DERBY-5239:
--------------------------------------

The change looks ok to me. Can anybody see any issues with this change? I haven't really been much involved in this area...

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Ed Costello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Costello updated DERBY-5239:
-------------------------------

    Attachment: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch

Attached is a patch replacing the two usages in Network Server with direct usage of the embedded driver.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036159#comment-13036159 ] 

Knut Anders Hatlen commented on DERBY-5239:
-------------------------------------------

The change looks fine to me too. The server code may now start using a different instance of the driver than the one found returned by DriverManager.getDriver(), but since all the methods of EmbeddedDriver end up calling static methods in AutoloadedDriver anyway, I don't think that it would cause any problems (like booting two engine instances in the same JVM).

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035322#comment-13035322 ] 

Knut Anders Hatlen commented on DERBY-5239:
-------------------------------------------

Do you have an example where the current code causes problems? It might be helpful for the reviewers to understand what kind of problem the patch fixes.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035329#comment-13035329 ] 

Knut Anders Hatlen commented on DERBY-5239:
-------------------------------------------

Ah, I see that my question has already been answered in a thread on derby-dev: http://mail-archives.apache.org/mod_mbox/db-derby-dev/201105.mbox/%3C1305683326.2425.34.camel@edwardc%3E

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035248#comment-13035248 ] 

Kristian Waagan commented on DERBY-5239:
----------------------------------------

Hi Ed,

Thanks for the patch :)
To allow the community to include your work in the code base, you have to grant a license to the ASF by ticking "Grant license to ASF for inclusion in ASF works (as per the Apache License ยง5)" on the upload page.
For extra credit you could also generate the patch using "svn diff" from the root directory of the source code hierarchy.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050377#comment-13050377 ] 

Knut Anders Hatlen commented on DERBY-5239:
-------------------------------------------

As a follow-up I've removed the (now unused) import statement that imports the DriverManager class in NetworkServerControlImpl. Committed revision 1136397.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>            Assignee: Ed Costello
>             Fix For: 10.9.0.0
>
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Ed Costello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Costello updated DERBY-5239:
-------------------------------

    Attachment: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch

Apologies for not ticking the box, I'm too used to skimming the Jira Attach dialog.

Attached is the same patch but generated from svn trunk [^svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch] Revision 1124404 & license box ticked.


> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5239:
--------------------------------------

    Fix Version/s: 10.8.1.4

Merged to 10.8. Committed revision 1138412.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>            Assignee: Ed Costello
>             Fix For: 10.8.1.4, 10.9.0.0
>
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Ed Costello (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Costello updated DERBY-5239:
-------------------------------

    Attachment:     (was: 0001-Remove-Driver-Manager-Usage-from-Network-Server.patch)

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Ed Costello (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036421#comment-13036421 ] 

Ed Costello commented on DERBY-5239:
------------------------------------

As an aside, that exact scenario is happening in the environment that I've patched this for, embedded driver is being explicitly initialized by the OSGi Service managing drivers & a second instance is initialized by the Network Server using this patch. I've seen no ill affects from this though I haven't done more than trivial tests.

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (DERBY-5239) Remove usages of DriverManager to obtain an Embedded Connection in Derby Server

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-5239.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.9.0.0
         Assignee: Ed Costello

All the regression tests ran cleanly with the patch.
Committed revision 1126468.

Thanks for fix, Ed!

> Remove usages of DriverManager to obtain an Embedded Connection in Derby Server
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-5239
>                 URL: https://issues.apache.org/jira/browse/DERBY-5239
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions: 10.6.1.0, 10.8.1.2
>            Reporter: Ed Costello
>            Assignee: Ed Costello
>             Fix For: 10.9.0.0
>
>         Attachments: svn-patch-Remove-Driver-Manager-Usage-from-Network-Server.patch
>
>
> The Derby Network Server appears to look up the Derby Embedded Driver from the {{java.sql.DriverManager}} in a couple of places in order to get the connection to the actual database.
> This means the network server cannot operate in environments where for whatever reason it is not OK to access the embedded driver from the DriverManager. Just in general this behavior is unexpected as it should be possible to directly load the embedded driver.
> I've observed this issue in 10.6.1.0 and checked that the relevant usages are unchanged in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira