- 增加 FreeSql.Provider.OracleOledb 解决US7ASCII 中文乱码问题;

This commit is contained in:
2881099
2022-08-23 01:28:47 +08:00
parent 4d91d87660
commit 25b98f2fe9
13 changed files with 590 additions and 36 deletions

View File

@ -1,11 +1,9 @@
using FreeSql.Internal;
using FreeSql.Internal.Model;
using Oracle.ManagedDataAccess.Client;
using FreeSql.Internal.ObjectPool;
using System;
using System.Collections;
using System.Data.Common;
using System.Text;
using System.Threading;
namespace FreeSql.Oracle
@ -63,8 +61,13 @@ namespace FreeSql.Oracle
public override DbCommand CreateCommand()
{
var cmd = new OracleCommand();
var cmd =
#if oledb
new System.Data.OleDb.OleDbCommand();
#else
new Oracle.ManagedDataAccess.Client.OracleCommand();
cmd.BindByName = true;
#endif
return cmd;
}

View File

@ -1,11 +1,15 @@
using Oracle.ManagedDataAccess.Client;
#if oledb
using System.Data.OleDb;
using OracleException = System.Data.OleDb.OleDbException;
using OracleConnection = System.Data.OleDb.OleDbConnection;
#else
using Oracle.ManagedDataAccess.Client;
#endif
using FreeSql.Internal.ObjectPool;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@ -121,7 +125,10 @@ namespace FreeSql.Oracle
public void OnDestroy(DbConnection obj)
{
try { if (obj.State != ConnectionState.Closed) obj.Close(); } catch { }
#if oledb
#else
try { OracleConnection.ClearPool(obj as OracleConnection); } catch { }
#endif
obj.Dispose();
}