Comment From: wilkinsona

This release appears to contain some breaking changes. A number of tests now fail with an exception like the following:

java.lang.AssertionError: pool start procedure finished with wrong life cycle state, lifecycle=Starting
    at oracle.ucp.common.UniversalConnectionPoolBase.start(UniversalConnectionPoolBase.java:903)
    at oracle.ucp.jdbc.PoolDataSourceImpl.startPool(PoolDataSourceImpl.java:844)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:1930)
    at oracle.ucp.jdbc.PoolDataSourceImpl$3.build(PoolDataSourceImpl.java:4243)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:1854)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:1811)
    at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:1797)
    at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330)
    at org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadataTests.getPoolSizeOneConnection(AbstractDataSourcePoolMetadataTests.java:65)

There's nothing logged to show why the start attempt failed and left the pool in Starting state.

Comment From: wilkinsona

I've discovered that the problem does not occur when running a main method, but it does occur when running a test:

import java.sql.Connection;
import java.sql.SQLException;

import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceImpl;
import org.junit.jupiter.api.Test;

import org.springframework.boot.jdbc.DataSourceBuilder;

class OracleUcpTests {

    @Test
    void getConnectionFromPoolDataSource() throws SQLException {
        PoolDataSource dataSource = DataSourceBuilder.create()
            .driverClassName("org.hsqldb.jdbc.JDBCDriver")
            .url("jdbc:hsqldb:mem:test")
            .username("sa")
            .type(PoolDataSourceImpl.class)
            .build();
        dataSource.setInitialPoolSize(0);
        dataSource.setMinPoolSize(0);
        dataSource.setMaxPoolSize(2);
        try (Connection connection = dataSource.getConnection()) {
            System.out.println(connection);
        }
    }

    public static void main(String[] args) throws SQLException {
        new OracleUcpTests().getConnectionFromPoolDataSource();
    }

}

With the above, running the main method outputs the connection to System.out. Running the test results in the same failure as shown above. The key difference between the two is whether or not assertions are enabled. In Eclipse and IntelliJ, tests are run with assertions enabled (-ea) by default but main methods are not.

@Kuassim, can you please help us out here? As far as I can tell UCP 23.2.0.0 does not work on a JVM with assertions enabled. We're upgrading from 21.9.0.0 which did not have this problem.

Comment From: Kuassim

Hey @Wilkinsona,

This is a known bug BUG 35152375 - Assertion in Topology.getServiceByName(String serviceName) fixed in the recent DB23c branches.

The fix will be available in a newer DB23c release. Sorry for the inconvenience!

Comment From: wilkinsona

Thanks, @Kuassim. Do you have a rough idea of the schedule for that release?

Comment From: Kuassim

Hey @wilkinsona,

There is no known schedule but presumably within the next 6 months or so (just my own speculation).

Comment From: wilkinsona

Thanks, again, @Kuassim. I'll close this one for now then. Hopefully we can revisit the upgrade prior to Spring Boot 3.2's release in November.