S
Silly Shen
I'm using System.Data.OracleClient, it works fine when the user name and password are correct.
But when the user name or password is incorrect, it has a process leftover in the oracle server box.
There's no Oracle connection established, but the Oracle process is not cleaned, and finally get
Error: "ORA-00020: maximum number of processes (%s) exceeded".
Did anybody experienced this problem before or have any idea how to solve this issue?
I tried to set the pool to on/off and set the Connection Lifetime, but it didn't help.
I'm using .net 1.1 plus Oracle 817 Client in Win2000 and Oracle 9i Server in Solaris.
Silly Shen
PS: my code is like this:
//Check the user login;
public bool Login(string userName, string password)
{
string genErrorMsg = "Failed to verify user "+userName;
OracleCommand dbComm = null;
OracleDataReader dbReader = null;
OracleConnection dbConn = null;
try
{
string connString = "data source=MyDatabase;user id="+userName+";password="+password+";Pooling=true;Connection Lifetime=30";
dbConn = new OracleConnection();
dbConn.ConnectionString = connString;
dbConn.Open();
dbComm = new OracleCommand();
dbComm.Connection = dbConn;
string strQuery = "select U.USER_ID, U.NAME as FULL_NAME"
+" from USERS U"
+" where upper(U.USER_ID)='"+userName.ToUpper()+"'";
dbComm.CommandText = strQuery;
dbReader = dbComm.ExecuteReader();
if (dbReader.Read())
return true;
else
return false;
}
catch (Exception e)
{
//Log and show error information
return false;
}
finally
{
if (dbReader!=null) dbReader.Close();
if (dbConn!=null)
{ dbConn.Close();
dbConn.Dispose(); }
}
}//End of Login(string userName, string password);
But when the user name or password is incorrect, it has a process leftover in the oracle server box.
There's no Oracle connection established, but the Oracle process is not cleaned, and finally get
Error: "ORA-00020: maximum number of processes (%s) exceeded".
Did anybody experienced this problem before or have any idea how to solve this issue?
I tried to set the pool to on/off and set the Connection Lifetime, but it didn't help.
I'm using .net 1.1 plus Oracle 817 Client in Win2000 and Oracle 9i Server in Solaris.
Silly Shen
PS: my code is like this:
//Check the user login;
public bool Login(string userName, string password)
{
string genErrorMsg = "Failed to verify user "+userName;
OracleCommand dbComm = null;
OracleDataReader dbReader = null;
OracleConnection dbConn = null;
try
{
string connString = "data source=MyDatabase;user id="+userName+";password="+password+";Pooling=true;Connection Lifetime=30";
dbConn = new OracleConnection();
dbConn.ConnectionString = connString;
dbConn.Open();
dbComm = new OracleCommand();
dbComm.Connection = dbConn;
string strQuery = "select U.USER_ID, U.NAME as FULL_NAME"
+" from USERS U"
+" where upper(U.USER_ID)='"+userName.ToUpper()+"'";
dbComm.CommandText = strQuery;
dbReader = dbComm.ExecuteReader();
if (dbReader.Read())
return true;
else
return false;
}
catch (Exception e)
{
//Log and show error information
return false;
}
finally
{
if (dbReader!=null) dbReader.Close();
if (dbConn!=null)
{ dbConn.Close();
dbConn.Dispose(); }
}
}//End of Login(string userName, string password);