SQLExceptionWrapper

class SQLExceptionWrapper(val wrappedException: OctaviusException) : SQLException

A wrapper class that adapts an OctaviusException into a standard java.sql.SQLException.

This wrapper is necessary for integration with standard JDBC components like connection pools (e.g., HikariCP) which rely on intercepting java.sql.SQLException to analyze connection state, evict dead connections, and properly interpret the SQLState.

It records no stack trace: the one that says where the failure happened is wrappedException's.

A SessionTerminatedException keeps the server's SQLSTATE here, and most of those codes - 25P04, 57P05 - are not ones a pool reads as a lost connection. So its wrapper chains a next exception in the class a pool does read, 08006, the way a driver reports the I/O failure that followed a FATAL: the first exception says why, the next that the connection is gone, and a pool evicts it at once rather than at its next validation.

Constructors

Link copied to clipboard
constructor(wrappedException: OctaviusException)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val errorCode: Int
Link copied to clipboard
open val message: String?
Link copied to clipboard
Link copied to clipboard
open val sqlState: String?
Link copied to clipboard

The original OctaviusException that is being wrapped.

Functions

Link copied to clipboard
open override fun fillInStackTrace(): Throwable
Link copied to clipboard

Finds the Octavius failure behind this throwable, if there is one.

Link copied to clipboard
open operator fun iterator(): MutableIterator<Throwable?>