davoustp commented on issue #170: Connections validated without explicit 
validation query leave a transaction open
URL: https://github.com/apache/tomcat/pull/170#issuecomment-503212478
 
 
   You mean that `silentlyRollbackTransactionIfNeeded()` at line 532?
   There is no `finally` block in this `try` statement.
   The `try` block needs either a commit or rollback, depending on the returned 
value from `isValid(int)`, and we need to rollback whenever an `Exception` is 
raised (in the `catch` block).
   
   There is one `finally` in the other (existing) code block at line 560: this 
was already in place, so left it here.
   
   I believe that this is actually an issue: the `rollback` is issued even if 
the `try` block did not raise any exception and committed its changes 
successfully - meaning that, unless the driver knows that this is a no-op 
(which I doubt), it will issue an unnecessary query (therefore a round-trip) to 
the DB.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to