Package org.mariadb.jdbc.pool
Class MariaDbInnerPoolConnection
- java.lang.Object
-
- org.mariadb.jdbc.MariaDbPoolConnection
-
- org.mariadb.jdbc.pool.MariaDbInnerPoolConnection
-
- All Implemented Interfaces:
javax.sql.PooledConnection,javax.sql.XAConnection
public class MariaDbInnerPoolConnection extends MariaDbPoolConnection
MariaDB pool connection for internal pool permit to add a last used information, to remove connection after staying in pool for long time.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLonglastUsed
-
Constructor Summary
Constructors Constructor Description MariaDbInnerPoolConnection(Connection connection)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidensureValidation()Reset last used time, to ensure next retrieval will validate connection before borrowingjava.util.concurrent.atomic.AtomicLonggetLastUsed()Indicate last time this pool connection has been used.voidlastUsedToNow()Set last poolConnection use to now.-
Methods inherited from class org.mariadb.jdbc.MariaDbPoolConnection
addConnectionEventListener, addStatementEventListener, close, fireConnectionClosed, fireConnectionErrorOccurred, fireStatementClosed, fireStatementErrorOccurred, flagsToString, getConnection, getXAResource, mapXaException, realClose, removeConnectionEventListener, removeStatementEventListener, xidToString
-
-
-
-
Constructor Detail
-
MariaDbInnerPoolConnection
public MariaDbInnerPoolConnection(Connection connection)
Constructor.- Parameters:
connection- connection to retrieve connection options
-
-
Method Detail
-
getLastUsed
public java.util.concurrent.atomic.AtomicLong getLastUsed()
Indicate last time this pool connection has been used.- Returns:
- current last used time (nano).
-
lastUsedToNow
public void lastUsedToNow()
Set last poolConnection use to now.
-
ensureValidation
public void ensureValidation()
Reset last used time, to ensure next retrieval will validate connection before borrowing
-
-