XdrInputStream and XdrOutputStream.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptiongetXdrIn()Gets the XDR input stream.Gets the XDR output stream.voidwithTransmitLock(TransmitAction transmitAction) RunsTransmitAction.transmit(XdrOutputStream)withgetXdrOut()ontransmitActionunder the transmit lock.
-
Method Details
-
getXdrIn
Gets the XDR input stream.- Returns:
- instance of
XdrInputStream - Throws:
SQLException- if no connection is opened or when exceptions occur retrieving the InputStream
-
getXdrOut
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
RunsTransmitAction.transmit(XdrOutputStream)withgetXdrOut()ontransmitActionunder 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 streamSQLException- for other database access errors- Since:
- 6.0.4
- See Also:
-