1111import java .util .concurrent .atomic .LongAdder ;
1212import java .util .concurrent .locks .ReentrantLock ;
1313
14+ import static io .ebean .datasource .pool .TransactionIsolation .description ;
15+
1416/**
1517 * A robust DataSource implementation.
1618 * <ul>
@@ -225,13 +227,8 @@ private void initialiseConnections() throws SQLException {
225227 tryEnsureMinimumConnections ();
226228 }
227229 startHeartBeatIfStopped ();
228- String msg = "DataSourcePool [" + name +
229- "] autoCommit[" + autoCommit +
230- "] transIsolation[" + TransactionIsolation .getDescription (transactionIsolation ) +
231- "] min[" + minConnections +
232- "] max[" + maxConnections +
233- "] in[" + (System .currentTimeMillis () - start ) + "ms]" ;
234- Log .info (msg );
230+ Log .info ("DataSource [{0}] autoCommit[{1}] transIsolation[{2}] min[{3}] max[{4}] in[{5}ms]" ,
231+ name , autoCommit , description (transactionIsolation ), minConnections , maxConnections , (System .currentTimeMillis () - start ));
235232 }
236233
237234 /**
@@ -336,7 +333,7 @@ private void notifyDown(SQLException reason) {
336333 // check and set false immediately so that we only alert once
337334 dataSourceUp .set (false );
338335 dataSourceDownReason = reason ;
339- Log .error ("FATAL: DataSourcePool [" + name + "] is down or has network error!!!" , reason );
336+ Log .error ("FATAL: DataSource [" + name + "] is down or has network error!!!" , reason );
340337 if (notify != null ) {
341338 notify .dataSourceDown (this , reason );
342339 }
@@ -361,12 +358,12 @@ private void notifyUp() {
361358 dataSourceUp .set (true );
362359 startHeartBeatIfStopped ();
363360 dataSourceDownReason = null ;
364- Log .error ("RESOLVED FATAL: DataSourcePool [" + name + "] is back up!" );
361+ Log .error ("RESOLVED FATAL: DataSource [" + name + "] is back up!" );
365362 if (notify != null ) {
366363 notify .dataSourceUp (this );
367364 }
368365 } else {
369- Log .info ("DataSourcePool [{0}] is back up!" , name );
366+ Log .info ("DataSource [{0}] is back up!" , name );
370367 }
371368 } finally {
372369 notifyLock .unlock ();
@@ -620,7 +617,7 @@ private void returnTheConnection(PooledConnection pooledConnection, boolean forc
620617
621618 void returnConnectionReset (PooledConnection pooledConnection ) {
622619 queue .returnPooledConnection (pooledConnection , true );
623- Log .warn ("Resetting DataSourcePool on read-only failure [{0}]" , name );
620+ Log .warn ("Resetting DataSource on read-only failure [{0}]" , name );
624621 reset ();
625622 }
626623
@@ -701,7 +698,7 @@ public void offline() {
701698 private void shutdownPool (boolean closeBusyConnections ) {
702699 stopHeartBeatIfRunning ();
703700 PoolStatus status = queue .shutdown (closeBusyConnections );
704- Log .info ("DataSourcePool [{0}] shutdown {1} psc[hit:{2} miss:{3} put:{4} rem:{5}]" , name , status , pscHit , pscMiss , pscPut , pscRem );
701+ Log .info ("DataSource [{0}] shutdown {1} psc[hit:{2} miss:{3} put:{4} rem:{5}]" , name , status , pscHit , pscMiss , pscPut , pscRem );
705702 dataSourceUp .set (false );
706703 }
707704
0 commit comments