@@ -46,7 +46,7 @@ interface Heartbeat {
4646 */
4747 private final DataSourceAlert notify ;
4848 private final DataSourcePoolListener poolListener ;
49- private final DataSourcePoolNewConnectionListener connectionListener ;
49+ private final NewConnectionInitializer connectionInitializer ;
5050 private final List <String > initSql ;
5151 private final String user ;
5252 private final String schema ;
@@ -110,7 +110,7 @@ interface Heartbeat {
110110 this .name = name ;
111111 this .notify = params .getAlert ();
112112 this .poolListener = params .getListener ();
113- this .connectionListener = params .getConnectionListener ();
113+ this .connectionInitializer = params .getConnectionInitializer ();
114114 this .autoCommit = params .isAutoCommit ();
115115 this .readOnly = params .isReadOnly ();
116116 this .failOnStart = params .isFailOnStart ();
@@ -436,8 +436,8 @@ private void testConnection() {
436436 * Initializes the connection we got from the driver.
437437 */
438438 private Connection initConnection (Connection conn ) throws SQLException {
439- if (connectionListener != null ) {
440- connectionListener . onCreatedConnection (conn );
439+ if (connectionInitializer != null ) {
440+ connectionInitializer . preInitialize (conn );
441441 }
442442 conn .setAutoCommit (autoCommit );
443443 // isolation level is set globally for all connections (at least for H2) and
@@ -475,8 +475,8 @@ private Connection initConnection(Connection conn) throws SQLException {
475475 }
476476 }
477477 }
478- if (connectionListener != null ) {
479- connectionListener . onAfterInitialized (conn );
478+ if (connectionInitializer != null ) {
479+ connectionInitializer . postInitialize (conn );
480480 }
481481 return conn ;
482482 }
0 commit comments