0

我有两个并发连接一个接一个地执行。我已经分别尝试过它们,它们似乎都运行得很好。但是当它们一起运行时(一个接一个,如下面的示例),它会引发对象引用错误。这可能是连接池的问题吗?

     OracleConnection conn = new OracleConnection (ConnectionString1))

        OracleCommand cmd = new OracleCommand("proc1", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.parameters.add("param1", OracleDbType.Varchar2 , 20 , ParameterDirection.Input);
        conn.Open();
        cmd.ExecuteReader();
        conn.close()

     OracleConnection conn2 = new OracleConnection (ConnectionString2))

        OracleCommand cmd2 = new OracleCommand("proc2", conn2);
        cmd2.CommandType = CommandType.StoredProcedure;
        //Exception raised in the next line
        cmd2.parameters.add("param1", OracleDbType.Varchar2 , 20 , ParameterDirection.Input);
        conn2.Open();
        cmd2.ExecuteReader();
        conn2.close();
4

0 回答 0