Hi,
So I'm using an O/R mapper framework (really a model driven dev framework), that supports persistence through ADO, and I can configure the ADO isolation level for select and update transactions.
I have these set to System.Data.IsolationLevel.ReadCommitted (value 4096 = 0x1000).
Question: What exact Firebird transaction settings do I get with this setting? I believe the framwork ends up calling FirebirdSql.Data.FirebirdClient.BeginTransaction(System.Data.IsolationLevel level) but I haven't tracked it down properly, so can't say for certain.
The settings I would like is something like, in Firebird terms:
SET TRANSACTION READ WRITE -- For update transaction, READ ONLY for select ones, I suppose, although not important. WAIT -- This is important, because we need to allow concurrent updates with wait semantics. ISOLATION LEVEL READ COMMITTED RECORD_VERSION LOCK TIMEOUT xxx -- Not sure what xxx should be, maybe not specify it at all.
If it's not possible to achieve this using any available System.Data.IsolationLevel, then I would hope that there's some other way I can get the settings i Want, by specifying some default for the process, some callback, event, hook, or whatever.
Any ideas?
(I have a separate thread with the framework authors to see if they can enable DB specific transaction settings and not just ADO stuff.)
Regards,
Kjell
Question: What exact Firebird transaction settings do I get with this setting? I believe the framwork ends up calling FirebirdSql.Data.FirebirdClient.BeginTransaction(System.Data.IsolationLevel level) but I haven't tracked it down properly, so can't say for certain.Here's the code that converts S.D.IsolationLevel into Firebird terms: https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbTransaction.cs#L551
OK, so for ReadCommitted I end up with a transaction with settings like these:
SET TRANSACTION READ WRITE NO WAIT ISOLATION LEVEL READ COMMITTED RECORD_VERSION
That would be fine except for the NO WAIT. Too bad...
The settings I would like is something like, in Firebird terms: SET TRANSACTION READ WRITE -- For update transaction, READ ONLY for select ones, I suppose, although not important. WAIT -- This is important, because we need to allow concurrent updates with wait semantics. ISOLATION LEVEL READ COMMITTED RECORD_VERSION LOCK TIMEOUT xxx -- Not sure what xxx should be, maybe not specify it at all. If it's not possible to achieve this using any available System.Data.IsolationLevel, then I would hope that there's some other way I can get the settings i Want, by specifying some default for the process, some callback, event, hook, or whatever. Any ideas?You can't do that with just S.D.IsolationLevel. You need to have access to FirebirdClient specific methods so that you can specify FbTransactionOptions (https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbTransactionOptions.cs) for BeginTransaction.
I see. Thanks. Will discuss further with the framework developer.
Regards, Kjell
FWIW I added an issue suggesting a simple hook implementation that would solve this problem and allow any user of the FB provider to specify whatever FbTransactionOptions they desire for any System.Data.IsolationLevel, i.e. tweak your default:
https://github.com/FirebirdSQL/NETProvider/issues/1172
Regards,
Kjell