I have a simple ado.net application that executes a 'select' statement on the iSeries. Our system operator found that the connections used by the applicaiton do not clear out of memory on the iSeries. Am I missing something here....
DataTable dtRecords = new DataTable();
iDb2Connection objConnection = null;
try
{
objConnection = new iDb2Connection("...");
idb2Command objCommand = new Idb2Command ("Select something from somewhere",objConnection);
using(idb2DataReader dr = objCommand.ExecuteReader())
{
dtRecords.Load(dr,LoadOption.OverwriteTable());
}
objCommand.Dispose();
}
catch(idb2Exception iS)
{
...
}
catch(SystemExceptions er)
{
...
}
finally
{
objConnection.Dispose();
}
DataTable dtRecords = new DataTable();
iDb2Connection objConnection = null;
try
{
objConnection = new iDb2Connection("...");
idb2Command objCommand = new Idb2Command ("Select something from somewhere",objConnection);
using(idb2DataReader dr = objCommand.ExecuteReader())
{
dtRecords.Load(dr,LoadOption.OverwriteTable());
}
objCommand.Dispose();
}
catch(idb2Exception iS)
{
...
}
catch(SystemExceptions er)
{
...
}
finally
{
objConnection.Dispose();
}