Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv26642
Modified Files:
PgCommandBuilder.cs
Log Message:
- Added changes for better fit to ADO.NET.
Index: PgCommandBuilder.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgCommandBuilder.cs 15 Aug 2003 17:49:05 -0000 1.3
--- PgCommandBuilder.cs 22 Aug 2003 19:17:31 -0000 1.4
***************
*** 230,235 ****
if (insertCommand == null)
{
! buildSchemaTable();
! buildInsertCommand(null, null);
}
--- 230,257 ----
if (insertCommand == null)
{
! bool mustClose = false;
! try
! {
! bool mustClose = false;
! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed)
! {
! mustClose = true;
! dataAdapter.SelectCommand.Connection.Open();
! }
!
! buildSchemaTable();
! buildInsertCommand(null, null);
! }
! catch (Exception ex)
! {
! throw ex;
! }
! finally
! {
! if (mustClose)
! {
! dataAdapter.SelectCommand.Connection.Close();
! }
! }
}
***************
*** 241,246 ****
if (updateCommand == null)
{
! buildSchemaTable();
! buildUpdateCommand(null, null);
}
--- 263,290 ----
if (updateCommand == null)
{
! bool mustClose = false;
! try
! {
! bool mustClose = false;
! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed)
! {
! mustClose = true;
! dataAdapter.SelectCommand.Connection.Open();
! }
!
! buildSchemaTable();
! buildUpdateCommand(null, null);
! }
! catch (Exception ex)
! {
! throw ex;
! }
! finally
! {
! if (mustClose)
! {
! dataAdapter.SelectCommand.Connection.Close();
! }
! }
}
***************
*** 252,257 ****
if (deleteCommand == null)
{
! buildSchemaTable();
! buildDeleteCommand(null, null);
}
--- 296,323 ----
if (deleteCommand == null)
{
! bool mustClose = false;
! try
! {
! bool mustClose = false;
! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed)
! {
! mustClose = true;
! dataAdapter.SelectCommand.Connection.Open();
! }
!
! buildSchemaTable();
! buildDeleteCommand(null, null);
! }
! catch (Exception ex)
! {
! throw ex;
! }
! finally
! {
! if (mustClose)
! {
! dataAdapter.SelectCommand.Connection.Close();
! }
! }
}
***************
*** 686,690 ****
}
! try
{
buildSchemaTable();
--- 752,757 ----
}
! bool mustClose = false;
! try
{
buildSchemaTable();
***************
*** 718,721 ****
--- 785,795 ----
e.Errors = exception;
e.Status = UpdateStatus.ErrorsOccurred;
+ }
+ finally
+ {
+ if (mustClose)
+ {
+ dataAdapter.SelectCommand.Connection.Close();
+ }
}
}
|