PooledConnection
class PooledConnection implements ConnectionInterface
Wraps a database Connection for use with Hypervel's connection pool.
This adapter implements Hypervel's pool ConnectionInterface, allowing our Laravel-ported Connection to work with Hypervel's pooling infrastructure.
Constants
| protected MAX_ERROR_COUNT |
Maximum allowed errors before marking connection as stale. |
Properties
| protected Connection|null | $connection | ||
| protected ConnectionFactory | $factory | ||
| protected LoggerInterface | $logger | ||
| protected float | $lastUseTime | ||
| protected float | $lastReleaseTime | ||
| protected float | $createdAt | ||
| protected float | $lifetimeExpiresAt | ||
| protected bool | $availableForReuse | ||
| protected bool | $invalid | ||
| protected Dispatcher|null | $dispatcher |
Methods
Get the underlying database connection.
Get the active connection, reconnecting if necessary.
Reconnect to the database.
Check if the connection is still valid.
Determine if this connection has been idle long enough to be evicted.
Ping already-open PDO connections.
Close the database connection.
Release the connection back to the pool.
Discard the connection from its pool.
Get the last use time.
Get the last release time.
Get the connection generation creation time.
Determine if this connection generation has reached its maximum lifetime.
Determine if the underlying connection has an open transaction.
Mark the connection as invalid.
Mark the connection as valid.
Get already-open PDO instances.
Ping PDO instances.
Details
at line 78
mixed
getConnection()
Get the underlying database connection.
at line 86
Connection
getActiveConnection()
Get the active connection, reconnecting if necessary.
at line 104
bool
reconnect()
Reconnect to the database.
at line 158
bool
check()
Check if the connection is still valid.
at line 190
bool
isIdleExpired(float|null $now = null)
Determine if this connection has been idle long enough to be evicted.
at line 202
bool
ping(float $timeout)
Ping already-open PDO connections.
at line 243
bool
close()
Close the database connection.
at line 259
void
release()
Release the connection back to the pool.
at line 306
void
discard()
Discard the connection from its pool.
at line 314
float
getLastUseTime()
Get the last use time.
at line 322
float
getLastReleaseTime()
Get the last release time.
at line 330
float
getCreatedAt()
Get the connection generation creation time.
at line 338
bool
isLifetimeExpired(float|null $now = null)
Determine if this connection generation has reached its maximum lifetime.
at line 350
bool
hasOpenTransaction()
Determine if the underlying connection has an open transaction.
at line 359
protected void
markInvalid()
Mark the connection as invalid.
at line 367
protected void
markValid()
Mark the connection as valid.
at line 377
protected array
getOpenPdos()
Get already-open PDO instances.
at line 403
static protected bool
pingPdos(array $pdos)
Ping PDO instances.
at line 441
protected void
refresh(Connection $connection)
Refresh the PDO connections.