/// <summary>
/// This method is responsible to release all portals used by this Connector.
/// </summary>
internal void ReleasePlansPortals()
{
Int32 i = 0;
if (_planIndex > 0)
{
for (i = 1; i <= _planIndex; i++)
{
try
{
//Query(new NpgsqlCommand(String.Format("deallocate \"{0}\";", _planNamePrefix + i), this));
using (NpgsqlCommand cmd = new NpgsqlCommand(String.Format("deallocate \"{0}\";", _planNamePrefix + i.ToString()), this))
{
cmd.ExecuteBlind();
}
}
// Ignore any error which may occur when releasing portals as this portal name may not be valid anymore. i.e.: the portal name was used on a prepared query which had errors.
catch (Exception) {}
}
}
_portalIndex = 0;
_planIndex = 0;
}