I was wondering what were the hidden performance implications of using the Database object in the Enterprise Library. I have an OleDbCommand (type=stored procedue) that is calling an IBM iSeries stored procedure that is taking anywhere from 1.5 to 4.5 minutes to complete.
If I manually run the sproc using the iSeries tools and similar parameters then it takes about 5 secs. So the performance slowdown is either in the network communication to the iSeries or something hidden within the Database object within the Enterprise library. Just looking for any ideas.
m_asi = DatabaseFactory.CreateDatabase("ASI-TEST");
using (var cmd = new OleDbCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = string.Format("{0}.P_VNDR_INV", m_strASISprocCatalog);
cmd.Parameters.Add("@RUN_ENV", OleDbType.Char, 1).Value = strEnvironmentCode;
cmd.Parameters.Add("@SIS_KEY", OleDbType.Char, 36).Value = InvFilter.SISKey;
cmd.Parameters.Add("@FROM_DTE", OleDbType.Char, 8).Value = InvFilter.CheckDateFrom.ToString("yyyyMMdd");
cmd.Parameters.Add("@TO_DTE", OleDbType.Char, 8).Value = InvFilter.CheckDateTo.ToString("yyyyMMdd");
cmd.Parameters.Add("@EXT_Y", OleDbType.Char, 1).Value = (InvFilter.IsExternal ? "Y" : "N");
cmd.Parameters.Add("@INC_Y", OleDbType.Char, 1).Value = (InvFilter.IncludeASI ? "Y" : "N");
cmd.Parameters.Add("@VND_ID", OleDbType.Char, 1800).Value = InvFilter.GetVendorQueryString(18, 1800);
// This call is the bottleneck
m_asi.ExecuteNonQuery(cmd);
}