- dotConnect version is 5.20.33.0
- Oracle server is v10g
- We are using direct connection
Our code is splitted in a lot of classes, but I try to explain the normal flow:
We have a class for database abastraction (open connection, execute queries...) and we instance an object that is shared for all objects that need to use the database.
Init of this object is done in a few steps:
1.- A webservice is requesting some data, so we identify database provider (firebird, sqlserver, oracle), next get the connection string.
2.- Get the required objects for this provider and initialize with the help of a framework factory:
Code: Select all
public DbProviderFactory ProviderFactory
{
get
{
if (this._ProviderFactory == null)
{
string ProviderInvariantName = null;
if (this._ProviderType == DataProvider.DPMsSqlServer)
{
ProviderInvariantName = "System.Data.SqlClient";
}
else if (this._ProviderType == DataProvider.DPOracle)
{
ProviderInvariantName = "Oracle.DataAccess.Client";
}
else if (this._ProviderType == DataProvider.DPOracleNet)
{
ProviderInvariantName = string.Empty;
}
else if (this._ProviderType == DataProvider.DPFirebird)
{
ProviderInvariantName = "FirebirdSql.Data.FirebirdClient";
}
else if (this._ProviderType == DataProvider.DPDevartOracle)
{
ProviderInvariantName = "Devart.Data.Oracle";
}
if (!string.IsNullOrEmpty (ProviderInvariantName))
{
this._ProviderFactory = System.Data.Common.DbProviderFactories.GetFactory (ProviderInvariantName);
}
}
return (this._ProviderFactory);
}
}
private DbConnection GetFactoryConnection ()
{
if (UseNetFrameworkFactory == true)
{
return (ProviderFactory.CreateConnection ());
}
else
{
if (this._ProviderType == DataProvider.DPNone)
{
return (null);
}
#if ORACLE
else if (this._ProviderType == DataProvider.DPDevartOracle)
{
return (new Devart.Data.Oracle.OracleConnection ());
}
else if (this._ProviderType == DataProvider.DPOracle)
{
return (null);
}
else if (this._ProviderType == DataProvider.DPOracleNet)
{
return (null);
}
#elif FIREBIRD
else if (this._ProviderType == DataProvider.DPFirebird)
{
return (new FirebirdSql.Data.FirebirdClient.FbConnection ());
}
#elif SQLSERVER
else if (this._ProviderType == DataProvider.DPMsSqlServer)
{
return (new System.Data.SqlClient.SqlConnection ());
}
#endif
else if (this._ProviderType == DataProvider.DPODBC)
{
return (new System.Data.Odbc.OdbcConnection ());
}
else if (this._ProviderType == DataProvider.DPOleDB)
{
return (new System.Data.OleDb.OleDbConnection ());
}
else
{
return (null);
}
}
}
.. same for Devart.Data.Oracle.OracleCommand, transaction and others...
3.- With all required database objects created (connection, transaction, command...), connection is opened.
Them, we follow the webservice call and go a business layer to a data acess layer. A sql query is generated and executed as:
Code: Select all
cmd.CommandType = CommandType.Text;
cmd.CommandText = Sql;
cmd.ExecuteReader(CommandBehavior.Default);
cmd is created previously from Devart.Data.Oracle.OracleCommand on main init object (step 2)
Bug is catched on
cmd.ExecuteReader(CommandBehavior.Default);
We can't post here the DDL script (we are talking of a big closed-source application with ~110 tables)
In the next days, we will try to test the queries sent with dbmonitor and if we found relevant data we contact again...