Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Labels:
      None
    • Environment:

      Java Servlet Contaner, for example JBoss, or Tomcat

      Description

      Please make the Callable<Connection> factory field of the JdbcDataSource a protected field.

      Follow the discussion on the thread linked below, to enable the use of JNDI lookup for a JdbcDataSource this field will need to be set by a subclass (JndiJdbcDataSource).

      http://www.nabble.com/DataImportHandler-that-uses-JNDI-lookup-tt22408996.html

      1. SOLR-1058.patch
        4 kB
        Jason Shepherd
      2. SOLR-1058.patch
        4 kB
        Jason Shepherd
      3. SOLR-1058.patch
        4 kB
        Shalin Shekhar Mangar
      4. SOLR-1058.patch
        4 kB
        Noble Paul

        Activity

        Hide
        Noble Paul added a comment -

        how about enhancing the JdbcDataSource to lookup a javax.sql.DataSource from jndi also

        example

        
        <dataSource name="j" jndiName="java:comp/env/jdbc/myDb" user="" password=""/>
        

        This will get a javax.sql.DataSource object registered in your app server using a given user name, password (optional)

        Show
        Noble Paul added a comment - how about enhancing the JdbcDataSource to lookup a javax.sql.DataSource from jndi also example <dataSource name= "j" jndiName= "java:comp/env/jdbc/myDb" user= "" password=" "/> This will get a javax.sql.DataSource object registered in your app server using a given user name, password (optional)
        Hide
        Noble Paul added a comment -

        the fix

        Show
        Noble Paul added a comment - the fix
        Hide
        Shalin Shekhar Mangar added a comment -

        Jason, did you get a chance to try this patch? If you are fine with this, we can commit it for 1.4

        Show
        Shalin Shekhar Mangar added a comment - Jason, did you get a chance to try this patch? If you are fine with this, we can commit it for 1.4
        Hide
        Shalin Shekhar Mangar added a comment -

        Patch in sync with trunk.

        Show
        Shalin Shekhar Mangar added a comment - Patch in sync with trunk.
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 757170.

        Thanks Jason and Noble!

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 757170. Thanks Jason and Noble!
        Hide
        Jason Shepherd added a comment -

        Hi Shalin,

        Haven't had a chance to try it yet. Someone in my team will try it soon, and I will post the result.

        Thanks again,
        Jason

        Show
        Jason Shepherd added a comment - Hi Shalin, Haven't had a chance to try it yet. Someone in my team will try it soon, and I will post the result. Thanks again, Jason
        Hide
        Jason Shepherd added a comment - - edited

        I made one small change, reversing the boolean check of driver is null. I have uploaded the changes.

        I used the Jndi source by adding the following to my data-config.xml

        <dataSource type="JdbcDataSource" jndiName="jndiName" user="username" password="password"/>

        Show
        Jason Shepherd added a comment - - edited I made one small change, reversing the boolean check of driver is null. I have uploaded the changes. I used the Jndi source by adding the following to my data-config.xml <dataSource type="JdbcDataSource" jndiName="jndiName" user="username" password="password"/>
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 762184.

        Thanks Jason!

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 762184. Thanks Jason!
        Hide
        Jason Shepherd added a comment -

        There was another small change, which I missed the first time I posted. The check of user != null before dataSource.getConnection()

        I have uploaded the patch again. Sorry for the inconvenience.

        Thanks guys, for your great work on Solr.

        Show
        Jason Shepherd added a comment - There was another small change, which I missed the first time I posted. The check of user != null before dataSource.getConnection() I have uploaded the patch again. Sorry for the inconvenience. Thanks guys, for your great work on Solr.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for Solr 1.4

        Show
        Grant Ingersoll added a comment - Bulk close for Solr 1.4

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Jason Shepherd
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development