File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/NHibernate.Test/NHSpecificTest/NH1908ThreadSafety Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
4
using System . Threading ;
5
+ using NHibernate . Util ;
5
6
using NUnit . Framework ;
6
7
7
8
namespace NHibernate . Test . NHSpecificTest . NH1908ThreadSafety
@@ -17,6 +18,23 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
17
18
// http://www.orafaq.com/forum/t/60019/2/ & http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/oracle/import/tns_listener
18
19
}
19
20
21
+ protected override void OnTearDown ( )
22
+ {
23
+ base . OnTearDown ( ) ;
24
+
25
+ if ( ! ( Dialect is Dialect . FirebirdDialect ) )
26
+ return ;
27
+
28
+ // Firebird will pool each connection created during the test and will not drop the created tables
29
+ // which will result in other tests failing when they try to create tables with same name
30
+ // By clearing the connection pool the tables will get dropped. This is done by the following code.
31
+ var fbConnectionType = ReflectHelper . TypeFromAssembly ( "FirebirdSql.Data.FirebirdClient.FbConnection" , "FirebirdSql.Data.FirebirdClient" , false ) ;
32
+ var clearPool = fbConnectionType . GetMethod ( "ClearPool" ) ;
33
+ var sillyConnection = sessions . ConnectionProvider . GetConnection ( ) ;
34
+ clearPool . Invoke ( null , new object [ ] { sillyConnection } ) ;
35
+ sessions . ConnectionProvider . CloseConnection ( sillyConnection ) ;
36
+ }
37
+
20
38
[ Test ]
21
39
public void UsingFiltersIsThreadSafe ( )
22
40
{
You can’t perform that action at this time.
0 commit comments