I would recommend that instead of optimizing step to close, it will be better to not obtain a new connection (in local txn case) when the connection is going to be associated to an existing connection. That would be cleaner approach and not obtain a connection when it will not be used.