Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lack of ambient transaction when auto-enlisting is activated [DNET764] #706

Closed
firebird-automations opened this issue May 28, 2017 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: Frédéric Delaporte (fredericdelaporte)

Block progress on DNET765
Jira_subtask_inward DNET791

When auto-enlistment is enabled, opening a Firebird connection without an ongoing ambient system transaction fails with error:
System.InvalidOperationException : There is no active TransactionScope to enlist transactions.

Quite self explanatory. But this behavior is exclusive to Firebird and quite unexpected for users of other database connections, and also unexpected according to MSDN about auto-enlistment:

> A connection object will automatically enlist in an existing distributed transaction if it determines that a transaction is active, which, in System.Transaction terms, means that Transaction.Current is not null. Automatic transaction enlistment occurs when the connection is opened. It will not happen after that even if a command is executed inside of a transaction scope.

https://msdn.microsoft.com/en-us/library/ms254973(v=vs.110).aspx#Anchor_1

Usually, enabling auto-enlistment does not mandate an active transaction for opening connection. The connection simply does not enlist to anything when opened if there are no active transaction at that time. (Thankfully, since most other db connections have auto-enlistment enabled by default.)

For reference, here is the list of other connections which I have tested and support opening with auto-enlistment enabled and lack of ambient transaction: SqlConnection, SQLiteConnection, SqlCeConnection, OdbcConnection, OracleConnection (managed & unmanaged), NpgsqlConnection, MySqlConnection.

Commits: 3ce7a82

@firebird-automations
Copy link
Author

Modified by: Frédéric Delaporte (fredericdelaporte)

summary: Supports lack of ambient transaction when auto-enlisting is activated => Support lack of ambient transaction when auto-enlisting is activated

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: vNextBig [ 10850 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue block progress on DNET765 [ DNET765 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

issuetype: New Feature [ 2 ] => Sub-task [ 5 ]

Parent: DNET791 [ 21933 ]

@firebird-automations
Copy link
Author

Commented by: Frédéric Delaporte (fredericdelaporte)

Thanks, tested with NHibernate test suit and 6.0.0-alpha2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants