<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1908ThreadSafety
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		protected override bool AppliesTo(Dialect.Dialect dialect)
		{
			return !(dialect is Dialect.Oracle8iDialect);
			// Oracle sometimes causes: ORA-12520: TNS:listener could not find available handler for requested type of server
			// Following links bizarrely suggest it's an Oracle limitation under load:
			// http://www.orafaq.com/forum/t/60019/2/ & http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/oracle/import/tns_listener
		}

		[Test]
		public void UsingFiltersIsThreadSafe()
		{<commit_msg>clear the pool after the test<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using NHibernate.Util;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1908ThreadSafety
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		protected override bool AppliesTo(Dialect.Dialect dialect)
		{
			return !(dialect is Dialect.Oracle8iDialect);
			// Oracle sometimes causes: ORA-12520: TNS:listener could not find available handler for requested type of server
			// Following links bizarrely suggest it's an Oracle limitation under load:
			// http://www.orafaq.com/forum/t/60019/2/ & http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/oracle/import/tns_listener
		}

		protected override void OnTearDown()
		{
			base.OnTearDown();

			if (!(Dialect is Dialect.FirebirdDialect))
				return;

			// Firebird will pool each connection created during the test and will not drop the created tables
			// which will result in other tests failing when they try to create tables with same name
			// By clearing the connection pool the tables will get dropped. This is done by the following code.
			var fbConnectionType = ReflectHelper.TypeFromAssembly("FirebirdSql.Data.FirebirdClient.FbConnection", "FirebirdSql.Data.FirebirdClient", false);
			var clearPool = fbConnectionType.GetMethod("ClearPool");
			var sillyConnection = sessions.ConnectionProvider.GetConnection();
			clearPool.Invoke(null, new object[] { sillyConnection });
			sessions.ConnectionProvider.CloseConnection(sillyConnection);
		}

		[Test]
		public void UsingFiltersIsThreadSafe()
		{
{'fraction_non_alphanumeric': 0.0880503144654088, 'fraction_numerical': 0.013417190775681341, 'mean_word_length': 4.640661938534279, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '981045', 'n_tokens_mistral': 801, 'n_tokens_neox': 705, 'n_words': 196}