02.06.2018 18:07, Mark Rotteveel wrote:
I just saw the following commit: 
https://github.com/FirebirdSQL/firebird/commit/bbf8348817c4592999fc137b18ba1be7326ad42d

This disallows execution of ALTER SESSION RESET if there are transactions 
active. I think this is too restrictive.

  Only from client POV and only at first look. Think about at as replacement
of detach\attach calls. At detach you have no active transactions or it will
fail with error.

For example, in Jaybird queries executed through the JDBC API will always be executed in a transaction. With this change, this statement must be executed without transaction, which means I must either include explicit support to detect this statement, or people need to break out of the JDBC API and use the underlying API, both are options I want to avoid (especially the last one). I think the same applies for other drivers.

  Could you add new method to reset connection ?
Will it "break out of the JDBC API" ?

  BTW, does JDBC API requires that any statement shoud run within explicit
transaction ? Does Jaybird allow to not start implicit transaction with
statement ? Does Jaybirs support execution of "SET TRANSACTION" statement ?
Also, all new session management statements could run with no transaction
context.

Instead I propose that execution of ALTER SESSION RESET within a transaction will not fail if the current transaction is the only active transaction of the connection.

  It must check too much things to not break it by reset. And list of things
to check could be changed in the future.

Also, I'm not 100% sure, but it also looks like the current restriction also doesn't allow for prepared but not yet committed transactions. Prepared transactions are not active, and presence of these should not block execution of ALTER SESSION RESET.

  If you speak about 2PC tranaction in prepared state - it is really active
and must be committed or rolled back (as any other active transaction).
If it in limbo state - it is inactive already.

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