Uploaded image for project: 'Hibernate ORM'
  1. HHH-10499

Can't set ConnectionProvider instance, regression

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 5.0.7
    • Fix versions: 5.0.9, 5.1.1
    • Components: None
    • Labels:
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      In AvailableSettings.java:

      /**
      	 * Names the {@link org.hibernate.engine.jdbc.connections.spi.ConnectionProvider} to use for obtaining
      	 * JDBC connections.  Can reference:<ul>
      	 *     <li>an instance of ConnectionProvider</li>
      	 *     <li>a {@code Class<? extends ConnectionProvider>} reference</li>
      	 *     <li>a {@code Class<? extends ConnectionProvider>} FQN</li>
      	 * </ul>
      	 * <p/>
      	 * The term {@code "class"} appears in the setting name due to legacy reasons; however it can accept instances.
      	 */
      	String CONNECTION_PROVIDER ="hibernate.connection.provider_class";
      

      The first two options are no longer supported with the "new" bootstrap code. It breaks because of this cast in ConnectionProviderInitiator.java:

      		String providerName = (String) configurationValues.get( AvailableSettings.CONNECTION_PROVIDER );
      

      And obviously the logic to handle an existing instance of the right type or a class reference is missing.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 38m
                38m