Ensure MyBatis "expectedConnectionTypeCode" is generated and matches valid database connections.
@@ -80,6 +80,13 @@ public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
});
+ // Force recalculation of expectedConnectionTypeCode. The
+ // PooledDataSource constructor accepting a single UnpooledDataSource
+ // will otherwise leave this value uninitialized, resulting in all
+ // connections failing to pass sanity checks and never being returned
+ // to the pool.
+ super.forceCloseAll();
+
}
@Override
