Class DatabricksTransactionException

  • All Implemented Interfaces:
    Serializable, Iterable<Throwable>

    public class DatabricksTransactionException
    extends SQLException
    Exception thrown for transaction-specific errors in the Databricks JDBC driver.

    This exception is used when server-side transaction errors occur that don't have a corresponding standard SQLException subclass. Examples include:

    • AUTOCOMMIT_SET_DURING_ACTIVE_TRANSACTION
    • AUTOCOMMIT_SET_FALSE_ALREADY_DISABLED
    • MULTI_STATEMENT_TRANSACTION_NO_ACTIVE_TRANSACTION

    For errors that have standard SQLException subclasses (e.g., transaction rollback required), those standard exceptions should be used instead.

    See Also:
    Serialized Form
    • Constructor Detail

      • DatabricksTransactionException

        public DatabricksTransactionException​(String reason,
                                              String sqlState,
                                              int vendorCode,
                                              Throwable cause)
        Constructs a DatabricksTransactionException with the specified reason, SQL state, vendor code, and cause.
        Parameters:
        reason - a description of the exception
        sqlState - the SQL state code
        vendorCode - the vendor-specific error code
        cause - the underlying cause of the exception
      • DatabricksTransactionException

        public DatabricksTransactionException​(String reason,
                                              Throwable cause,
                                              DatabricksDriverErrorCode internalError)
        Constructs a DatabricksTransactionException with the specified reason, driver error code, and cause.

        This constructor intelligently extracts vendor codes and SQL state from the cause exception:

        • If the cause is a SQLException with a non-zero error code, that vendor code is preserved
        • Otherwise, attempts to extract vendor code from the exception chain using DatabricksVendorCode
        • SQL state is preserved from the SQLException if available
        Parameters:
        reason - a description of the exception
        cause - the underlying cause of the exception
        internalError - the driver error code (used for telemetry and as SQL state fallback)