Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
ReadAheadBufferedStream is a port of MySQL Connector/J's useReadAheadInput option.
The one historical difference was locking: BufferedInputStream methods were synchronized, while the driver's class relies on the statement lock and has none. Since JDK 19 (JDK-8284161, virtual threads), BufferedInputStream uses an internal ReentrantLock instead of the monitor when it is not subclassed, precisely so that a blocking read does not pin a virtual thread. The two classes are the same implementation, and the driver's copy has no reason to exist anymore.