Friday, July 17, 2009

ORA-29701 when calling System.Data.OracleClient.OracleLob.Write

I recently experienced some unhandled errors when attempting to install a custom module in a DotNetNuke site that had an Oracle back end.  The DB provider I was using was AcuitiDB.

After some debugging, I was able to establish that the error was being raised from a call to AddDesktopModule, and the StackTrace showed that it was originating in a call to System.Data.OracleClient.OracleLob.Write:

[OracleException (0x80131938): ORA-29701: unable to connect to Cluster Manager

]

   System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +304889

   System.Data.OracleClient.OracleLob.Write(Byte[] buffer, Int32 offset, Int32 count) +587

   DotNetNuke.Data.OracleSqlHelper.CreateClobParameter(String ConnectionString, String ParameterName, String p) +229

I contacted Sanjay Mehrota at Acuiti and he was very helpful in assisting me to track down the cause of this.  Firstly, he suggested that I try some other areas of the site that created clobs, such as the text/html module.  This exhibited the same error.  He also provided some test code for creating a temporary clob which I added to a simple console app as a test harness.  This initially appeared to work correctly, but when I increased the size of the string being used to around 29,000 bytes, I got the same error.  It transpires that Temporary clobs are created in the temporary tablespace and that owing to some other testing work that was being performed on the DB, we had run out of tablespace.  I got the DBA to increase the size of the temporary tablespace and the problem disappeared.