arturobernalg opened a new pull request, #1268:
URL: https://github.com/apache/tomcat/pull/1268

   https://bz.apache.org/bugzilla/show_bug.cgi?id=70370
   
   Since 11.0.28, 10.1.62 and 9.0.124 the pool sends 
`Connection.beginRequest()` and `endRequest()` around each borrow (#677). The 
behaviour of `endRequest()` is vendor specific, and the Microsoft SQL Server 
driver (mssql-jdbc 13.2.1) closes every statement created during the request. A 
statement parked by `StatementCache` outlives the request, so every other 
borrow was handed a statement the driver had already closed (`The statement is 
closed.`). HSQLDB 2.7.4 fails the same way.
   
   The hints are now sent only when the new `useRequestBoundaries` attribute is 
enabled (default `false`, the behaviour before 11.0.28), and never for a 
connection whose interceptor chain includes `StatementCache`.
   
   Testing:
   - Tomcat with a JNDI jdbc-pool DataSource using the reporter's 
configuration, mssql-jdbc 13.2.1 and SQL Server 2022, 20 threads: 11.0.26 0 of 
4000 failed, 11.0.29 3490 of 4000 failed. With this change 0 of 4000, also with 
`useRequestBoundaries="true"`.
   - New tests in `RequestBoundariesBase` use a driver whose `endRequest()` 
closes the statements of the request. The `StatementCache` test fails on main 
with "The object is already closed". Removing the `StatementCache` guard makes 
the two tests that cover it fail.
   - All jdbc-pool tests pass (1098).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to