23.05.2018 15:59, Dimitry Sibiryakov wrote:
23.05.2018 14:40, Mark Rotteveel wrote:
I think it should unconditionally do a session reset on return to the pool if the protocol is v16 or higher (assuming v16 is the Firebird 4 protocol version).

   This is not truly unconditionally :)

   But relying on protocol version is also not perfect - remote server could be
upgraded at some moment (v3 -> v4) and whole system behaviour will be changed
(automatically and not very expectedly).

   At first, at API level there is no way to find out protocol version and no 
easy way to find out remote server version/capacities.

  Protocol version could be made known to the engine, no doubt

   At second, there is no way to upgrade server without breaking established 
connection (obviously).

  Nobody tell about it. And it change nothing.

   At third, behavior of pooled connection must exactly match behavior of 
non-pooled connection no mater what happen.

  So, why we discuss ON RESET trigger(s) ? ;)

  If gather all this together, IMHO, it is enough to do reset unconditionally and, if it has failed for any reason, to mark EDS as non-pooled in metadata cache. It will eliminate extra round-trip in cases when pooling is impossible.

  There is no such thing as "EDS" in metadata cache. So, no - it will not save 
round-trip.

  As for overhead of this round-trip in pooled connection, I think that the statement can be sent by pool in background mode after the connection is returned to it. Of course, during this the connection won't be available for re-use, but for pool it doesn't matter as it always can have some spare connections at hand.

  I already told about it at my previous answer to Mark.

BTW, MSSQL run its sp_reset_connection with first statement of reused 
connection.
It set special bit at protocol level to do it:

https://blogs.msdn.microsoft.com/psssql/2014/03/03/sp_reset_connection-rate-usage-dont-fight-over-the-grapes/

Regards,
Vlad

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to