Interface XdrStreamAccess


@NullMarked public interface XdrStreamAccess
Provides access to the XdrInputStream and XdrOutputStream.
Since:
3.0
Author:
Mark Rotteveel
  • Method Details

    • getXdrIn

      XdrInputStream getXdrIn() throws SQLException
      Gets the XDR input stream.
      Returns:
      instance of XdrInputStream
      Throws:
      SQLException - if no connection is opened or when exceptions occur retrieving the InputStream
    • getXdrOut

      XdrOutputStream getXdrOut() throws SQLException
      Gets the XDR output stream.
      Returns:
      instance of XdrOutputStream
      Throws:
      SQLException - if no connection is opened or when exceptions occur retrieving the OutputStream
      See Also:
    • withTransmitLock

      void withTransmitLock(TransmitAction transmitAction) throws IOException, SQLException
      Runs TransmitAction.transmit(XdrOutputStream) with getXdrOut() on transmitAction under the transmit lock.

      For Jaybird 5 and 6, the transmit lock only needs to be used for statement operations and cancellation. See also jdp-2026-02: Cancellation thread-safety backport

      The transmit lock should only cover sending messages to the server. It should be held for the duration of the entire message. It must be released before reading (receiving) messages from the server. If possible, do not do anything other than writing to the XDR output stream while holding the lock.

      Normal operations must obtain the lock while holding the connection lock (i.e. the various withLock() methods). Out-of-band operations (e.g. cancellation) must not take out the connection lock, otherwise they can't be out-of-band.

      Note for implementations: the lock used must be reentrant.

      Parameters:
      transmitAction - the transmit action to run under lock
      Throws:
      IOException - for errors writing to the XDR output stream
      SQLException - for other database access errors
      Since:
      6.0.4
      See Also: