Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20101
Modified Files:
PgCommand.cs
Log Message:
Changes on implicit transaction support
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** PgCommand.cs 10 Apr 2004 20:15:32 -0000 1.34
--- PgCommand.cs 2 May 2004 14:21:10 -0000 1.35
***************
*** 467,471 ****
if (this.commandType == CommandType.StoredProcedure)
{
! this.commands[actualCommand] = parseSPCommandText();
}
--- 467,471 ----
if (this.commandType == CommandType.StoredProcedure)
{
! this.commands[actualCommand] = this.buildStoredProcedureSql();
}
***************
*** 600,610 ****
private void checkCommand()
{
! if (this.transaction != null &&
! this.transaction.IsUpdated)
{
this.transaction = null;
}
! if (this.connection == null ||
! this.connection.State != ConnectionState.Open)
{
throw new InvalidOperationException("Connection must valid and open");
--- 600,608 ----
private void checkCommand()
{
! if (this.transaction != null && this.transaction.IsUpdated)
{
this.transaction = null;
}
! if (this.connection == null || this.connection.State != ConnectionState.Open)
{
throw new InvalidOperationException("Connection must valid and open");
***************
*** 620,629 ****
throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized.");
}
! if (this.transaction != null &&
! !this.connection.Equals(Transaction.Connection))
{
throw new InvalidOperationException("Command Connection is not equal to Transaction Connection");
}
! if (this.commandText == String.Empty || this.commandText == null)
{
throw new InvalidOperationException ("The command text for this Command has not been set.");
--- 618,626 ----
throw new InvalidOperationException("Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized.");
}
! if (this.transaction != null && !this.connection.Equals(Transaction.Connection))
{
throw new InvalidOperationException("Command Connection is not equal to Transaction Connection");
}
! if (this.commandText == null || this.commandText.Length == 0)
{
throw new InvalidOperationException ("The command text for this Command has not been set.");
***************
*** 631,637 ****
}
! private string parseSPCommandText()
{
! string result = CommandText;
if (!commandText.Trim().ToLower().StartsWith("select "))
--- 628,634 ----
}
! private string buildStoredProcedureSql()
{
! string commandText = this.commands[actualCommand];
if (!commandText.Trim().ToLower().StartsWith("select "))
***************
*** 640,644 ****
// Append the stored proc parameter name
! paramsText.Append(CommandText);
paramsText.Append("(");
--- 637,641 ----
// Append the stored proc parameter name
! paramsText.Append(commandText);
paramsText.Append("(");
***************
*** 661,668 ****
paramsText.Replace(",)", ")");
! result = "select * from " + paramsText.ToString();
}
! return result;
}
--- 658,665 ----
paramsText.Replace(",)", ")");
! commandText = "select * from " + paramsText.ToString();
}
! return commandText;
}
***************
*** 733,752 ****
for (int i = 0; i < this.statement.Parameters.Length; i++)
{
! string parameterName = parameters[i].ParameterName;
! if (this.namedParameters.Count != 0)
{
! try
! {
! parameterName = this.namedParameters[i].Trim();
! }
! catch
! {
! parameterName = this.parameters[i].ParameterName;
! }
}
- int index = this.parameters.IndexOf(parameterName);
-
if (this.parameters[index].Direction == ParameterDirection.Input ||
this.parameters[index].Direction == ParameterDirection.InputOutput)
--- 730,740 ----
for (int i = 0; i < this.statement.Parameters.Length; i++)
{
! int index = i;
! if (this.namedParameters.Count > 0)
{
! index = this.parameters.IndexOf(this.namedParameters[i]);
}
if (this.parameters[index].Direction == ParameterDirection.Input ||
this.parameters[index].Direction == ParameterDirection.InputOutput)
|