Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema
In directory sc8-pr-cvs1:/tmp/cvs-serv22058
Modified Files:
PgAbstractDbSchema.cs
Log Message:
* source/DbSchema/PgAbstractDbSchema.cs:
- Added fix for transaction handling.
- Added better exception handling.
Index: PgAbstractDbSchema.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/DbSchema/PgAbstractDbSchema.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PgAbstractDbSchema.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1
--- PgAbstractDbSchema.cs 25 Oct 2003 21:01:23 -0000 1.2
***************
*** 176,191 ****
restrictions = ParseRestrictions(restrictions);
! PgCommand command = new PgCommand();
! command.Connection = connection;
! command.CommandText = GetCommandText(restrictions);
!
! PgDataAdapter adapter = new PgDataAdapter(command);
! DataSet dataSet = new DataSet(tableName);
! adapter.Fill(dataSet, tableName);
! command.Dispose();
! adapter.Dispose();
return dataSet.Tables[tableName];
--- 176,211 ----
restrictions = ParseRestrictions(restrictions);
! DataSet dataSet = null;
! PgDataAdapter adapter = null;
! PgCommand command = new PgCommand();
! try
! {
! command.Connection = connection;
! command.CommandText = GetCommandText(restrictions);
! if (connection.ActiveTransaction != null &&
! !connection.ActiveTransaction.IsUpdated)
! {
! command.Transaction = connection.ActiveTransaction;
! }
! adapter = new PgDataAdapter(command);
! dataSet = new DataSet(tableName);
! adapter.Fill(dataSet, tableName);
! }
! catch (PgException pgex)
! {
! throw pgex;
! }
! catch (Exception ex)
! {
! throw new PgException(ex.Message);
! }
! finally
! {
! command.Dispose();
! adapter.Dispose();
! }
return dataSet.Tables[tableName];
|