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 22using System . Collections . Generic ;
33using System . Linq ;
44using System . Threading ;
5+ using NHibernate . Util ;
56using NUnit . Framework ;
67
78namespace NHibernate . Test . NHSpecificTest . NH1908ThreadSafety
@@ -17,6 +18,23 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
1718 // http://www.orafaq.com/forum/t/60019/2/ & http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/oracle/import/tns_listener
1819 }
1920
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+
2038 [ Test ]
2139 public void UsingFiltersIsThreadSafe ( )
2240 {
You can’t perform that action at this time.
0 commit comments