File tree Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -192,11 +192,11 @@ public async Task CanUseSessionWithManyScopesAsync(bool explicitFlush)
192
192
// being concurrently disposed of. See https://github.com/nhibernate/nhibernate-core/pull/1505 for more details.
193
193
if ( Sfi . ConnectionProvider . Driver is OdbcDriver )
194
194
Assert . Ignore ( "ODBC sometimes fails on second scope by checking the previous transaction status, which may yield an object disposed exception" ) ;
195
- // SAP HANA .Net provider always causes system transactions to be distributed, causing them to complete
196
- // on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
195
+ // SAP HANA & SQL Anywhere .Net provider always causes system transactions to be distributed, causing them to
196
+ // complete on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
197
197
// finding the connection still enlisted in the previous transaction, its complete being still not finished
198
198
// on its own thread.
199
- if ( Sfi . ConnectionProvider . Driver is HanaDriverBase )
199
+ if ( Sfi . ConnectionProvider . Driver is HanaDriverBase || Sfi . ConnectionProvider . Driver is SapSQLAnywhere17Driver )
200
200
Assert . Ignore ( "SAP HANA scope handling causes concurrency issues preventing chaining scope usages." ) ;
201
201
202
202
using ( var s = WithOptions ( ) . ConnectionReleaseMode ( ConnectionReleaseMode . OnClose ) . OpenSession ( ) )
Original file line number Diff line number Diff line change @@ -181,11 +181,11 @@ public void CanUseSessionWithManyScopes(bool explicitFlush)
181
181
// being concurrently disposed of. See https://github.com/nhibernate/nhibernate-core/pull/1505 for more details.
182
182
if ( Sfi . ConnectionProvider . Driver is OdbcDriver )
183
183
Assert . Ignore ( "ODBC sometimes fails on second scope by checking the previous transaction status, which may yield an object disposed exception" ) ;
184
- // SAP HANA .Net provider always causes system transactions to be distributed, causing them to complete
185
- // on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
184
+ // SAP HANA & SQL Anywhere .Net provider always causes system transactions to be distributed, causing them to
185
+ // complete on concurrent threads. This creates race conditions when chaining scopes, the subsequent scope usage
186
186
// finding the connection still enlisted in the previous transaction, its complete being still not finished
187
187
// on its own thread.
188
- if ( Sfi . ConnectionProvider . Driver is HanaDriverBase )
188
+ if ( Sfi . ConnectionProvider . Driver is HanaDriverBase || Sfi . ConnectionProvider . Driver is SapSQLAnywhere17Driver )
189
189
Assert . Ignore ( "SAP HANA scope handling causes concurrency issues preventing chaining scope usages." ) ;
190
190
191
191
using ( var s = WithOptions ( ) . ConnectionReleaseMode ( ConnectionReleaseMode . OnClose ) . OpenSession ( ) )
Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ protected void DisableConnectionAutoEnlist(Configuration configuration)
52
52
protected void IgnoreIfUnsupported ( bool explicitFlush )
53
53
{
54
54
Assume . That (
55
- new [ ] { explicitFlush , UseConnectionOnSystemTransactionPrepare } ,
55
+ new [ ]
56
+ {
57
+ explicitFlush ,
58
+ UseConnectionOnSystemTransactionPrepare && TestDialect . SupportsUsingConnectionOnSystemTransactionPrepare
59
+ } ,
56
60
Has . Some . EqualTo ( true ) ,
57
61
"Implicit flush cannot work without using connection from system transaction prepare phase" ) ;
58
62
}
Original file line number Diff line number Diff line change @@ -138,5 +138,10 @@ public bool SupportsSqlType(SqlType sqlType)
138
138
/// Even quoted, some databases do not support square bracket in identifiers.
139
139
/// </summary>
140
140
public virtual bool SupportsSquareBracketInIdentifiers => true ;
141
+
142
+ /// <summary>
143
+ /// Some databases fail when a connection is enlisted during the first phase of a two phase commit.
144
+ /// </summary>
145
+ public virtual bool SupportsUsingConnectionOnSystemTransactionPrepare => true ;
141
146
}
142
147
}
Original file line number Diff line number Diff line change @@ -21,5 +21,11 @@ public SapSQLAnywhere17TestDialect(Dialect.Dialect dialect)
21
21
/// It seems they have decide to remove this support starting from version 16.
22
22
/// </remarks>
23
23
public override bool SupportsSquareBracketInIdentifiers => false ;
24
+
25
+ /// <inheritdoc />
26
+ /// <remarks>
27
+ /// SQL Anywhere freezes on commit and the transaction ends by timeout.
28
+ /// </remarks>
29
+ public override bool SupportsUsingConnectionOnSystemTransactionPrepare => false ;
24
30
}
25
31
}
You can’t perform that action at this time.
0 commit comments