diff --git a/src/NHibernate.Test/TestCase.cs b/src/NHibernate.Test/TestCase.cs index f1d04a96640..49ce2be95b7 100644 --- a/src/NHibernate.Test/TestCase.cs +++ b/src/NHibernate.Test/TestCase.cs @@ -303,6 +303,9 @@ protected virtual void DropSchema() public static void DropSchema(bool useStdOut, SchemaExport export, ISessionFactoryImplementor sfi, Func getConnection = null) { + using(var optionalConnection = getConnection?.Invoke()) + export.Drop(useStdOut, true, optionalConnection); + if (sfi?.ConnectionProvider.Driver is FirebirdClientDriver fbDriver) { // Firebird will pool each connection created during the test and will marked as used any table @@ -313,9 +316,6 @@ public static void DropSchema(bool useStdOut, SchemaExport export, ISessionFacto // Moved from NH1908 test case, contributed by Amro El-Fakharany. fbDriver.ClearPool(null); } - - using(var optionalConnection = getConnection?.Invoke()) - export.Drop(useStdOut, true, optionalConnection); } ///