Skip to content

Version 2.6.0

Choose a tag to compare

@CaesarAugustus27 CaesarAugustus27 released this 21 Oct 17:54
· 168 commits to master since this release

Driver

Added

  • SessionTerminatedException: a session the server ended arrives as the reason the server gave -
    TRANSACTION_TIMEOUT, IDLE_SESSION_TIMEOUT, ADMINISTRATOR_COMMAND or UNKNOWN. The next call on the session
    names the same reason, and a pool evicts the connection.

  • @Transactional(timeout = …) is enforced by OctaviusJdbcTransactionManager, and so are a
    TransactionTemplate's timeout and spring.transaction.default-timeout. timeoutScope picks the setting:
    STATEMENT (statement_timeout, the default) or TRANSACTION (transaction_timeout).

  • The auto-configured transaction manager takes Boot's transaction manager customizers, so the
    spring.transaction.* properties and a TransactionManagerCustomizer bean reach it.

Changed

  • [BREAKING] ExecutionAbortedExceptionReason and ExecutionAbortedException.reason are gone: 25P03 and 25P04
    are SessionTerminatedException(TRANSACTION_TIMEOUT) now. A when over the enum or code reading reason stops
    compiling, and a catch of ExecutionAbortedException no longer sees either timeout.

  • [BREAKING] A FATAL is SessionTerminatedException whatever its SQLSTATE, where an ERROR with the same code
    routes as before: FATAL 57P01 is not a DatabaseSystemException, nor FATAL 40001 a ConcurrencyException.

  • [BREAKING] A login the server refuses is InitializationException whatever its SQLSTATE -
    SERVER_REJECTED_CREDENTIALS for class 28, CONNECTION_ERROR with the code in sqlState for the rest.

  • A SQLExceptionWrapper over a terminated session chains a next exception with SQLSTATE 08006, so a pool evicts
    the connection at once rather than at its next validation.

  • Each exchange reads what the server sent since the last one before writing anything, so a FATAL that arrived
    while the session sat idle is reported without the statement being sent.

  • OctaviusJdbcTransactionManager stays quiet on a rollback that finds the connection gone, where the rollback's
    failure replaced the application's exception.

  • [BREAKING] writeToCopy reports a row the server rejected rather than sending the next chunk, and the
    InputStream overload of copyIn stops reading its input there. A catch around endCopy() alone no longer sees a
    row rejected mid-transfer.

  • [BREAKING] The auto-configured transaction manager stands back from any TransactionManager the application
    declares, as Boot's does, a reactive one included. An application with a reactive one has to declare Octavius's
    itself.

  • [BREAKING] An unqualified type name the search path does not reach is refused, naming the schemas that have it,
    where the driver took it from the one schema defining it. A registration or a withPgType name without its schema
    fails where the path does not reach it.

  • [BREAKING] No temporary type is in the catalog, a temporary table's row type among them. A whole row of a
    temporary table now fails when the result is described; cast it to a permanent composite.

  • [BREAKING] A codec declaring OID 0 is refused by registerCodec, with
    InvalidOperationException(INVALID_ARGUMENT). A registration declaring 0 throws where it used to pass.

  • A data class mapped reflectively allocates about half as much read, and as much as a hand-written converter
    written as a composite.

Fixed

  • A FATAL is reported as itself, where the driver reported the closed connection after it, or waited for the
    close for good under the default socket timeout. A failed write reports it too on a plain connection, and so does
    a listener loop the server ends.

  • Closing a pooled session over a broken connection lets the pool evict the connection. The pool went on counting
    it as borrowed, so a single socket timeout exhausted a pool of one.

  • cancelCopy() on a connection that has gone does nothing, so the copyIn/copyOut overloads that cancel on
    failure report the failure, not the cancel's.

  • A transactionTimeout holds under a transaction_timeout default set on the database, the role or the session,
    where it was ignored.

  • With several DataSource beans the Spring auto-configuration builds on the @Primary one, and with none primary
    contributes nothing, instead of failing the startup.

  • The auto-configured transaction manager can be injected as OctaviusJdbcTransactionManager by a bean created
    before it.

  • [BREAKING] The JDBC Statement fails in a SQLExceptionWrapper, as the connection does, so Spring's script
    runner recognizes the failure: spring.sql.init.continue-on-error carries on past it, and without it the failure
    names its script and statement. A catch of the driver's exception around a Statement no longer sees it;
    wrappedException holds it.

  • A server certificate signed with RSASSA-PSS is hashed for channel binding with the digest in the signature's
    parameters, as the server hashes it: over SHA-384 or SHA-512 a login under channelBinding=prefer failed.

  • A server certificate signed with Ed25519 or Ed448 is refused before the SCRAM exchange, under
    channelBinding=prefer as under require, with InitializationException(UNSUPPORTED_MECHANISM) naming
    channelBinding=disable.

  • [BREAKING] An unqualified type name resolves to the type the server picks for it, the reported search_path being
    read as the server reads it: $user, pg_catalog first unless listed, unquoted names folded. A type of your own
    named like a built-in one - money, point - now resolves to the built-in where no schema is given, and a schema
    named after the user is searched where $user stands.

  • [BREAKING] A result converter registered under a sealed class is offered every class below it, as a codec for a
    sealed class already was: one under PgInterval was never asked about an interval. Such a converter is now asked
    ahead of those under Any::class.

Client

Changed

  • [BREAKING] A login the server refuses is thrown under dbResult, transactionResult and asResult, as every
    session that could not be obtained is. A Failure branch that handled 53300 or 57P03 no longer sees them.