Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-80

MySQLDataSource ignores calls to setPort/setDatabaseName/setServerName after calling getConnection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.5
    • 1.1.8
    • None
    • None

    Description

      As soon the getConnection method is called on an instance of MySQLDataSource a connection URL is constructed and cached.
      The cached URL isn't cleared/reconstructed during a call to setPort/setDatabaseName/setServerName.
      To reproduce it is important to call getConnection before changed on of
      the properties, because as long getConnection hasn't been called, the
      internal method createURL isn't called. The method creates a connection based on set properties, if the reference to the url is NULL. Hence the next
      call just returns the cached URL, without taking any changes to port/databasename/servername into consideration.

      I think it is easily fixable with just setting the url reference on NULL if a method of setPort/setDatabaseName/setServerName is called.

      Attachments

        Activity

          People

            massimo.siani Massimo Siani (Inactive)
            max.larsson Max Larsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.