Hi AX,
I'm trying to reproduce this so I can investigate it, but I'm running into some problems. Can you provide the following information that might help me?
(1) SQL to create the table. Here is what I used:
create table appconfig (configid NUMBER CONSTRAINT configid_pk PRIMARY KEY, configvalue CLOB);
With the table like this, my OracleCommandBuilder fails to generate the UpdateCommand for the query you provided, because the query doesn't contain the primary key. Since your query only contains one column, and your problem description indicates it's a CLOB, I'm not sure how your OracleCommandBuilder is working, since you can't make the CLOB the primary key.
(2) How would you know if any errors are occurring? Your catch blocks don't output any information when errors occur. I would suggest adding some way to output the error message and call stack (e.g. ex.ToString()). I assume you stepped through this in a debugger, or somehow concluded no errors were occurring, but normally you wouldn't want to just eat the errors in this scenario.
(3) Are you sure the update is actually going through to the database? If so, how did you verify that? Is it because you have an initial value in the row, and it's actually changed after the code runs? Or have you run client or server-side tracing to verify what is being sent? System.Data.OracleClient is built on top of Oracle's OCI API, so you can use their OCI tracing to see what's happening at that level. For reference on how to do that, see: http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/sqlnet.htm. That doc is for 10g, but at least the basic settings should work on 9i as well. For example, the following is what I use in my sqlnet.orato turn on OCI tracing:
trace_level_client=16 trace_file_client=client trace_directory_client=c:\OraCliTraces trace_unique_client=true
The folder you specify in c:\OraCliTraces can be anything you want, just make sure you create it before tracing. After you make these changes in sqlnet.ora, run your application. You should see the UPDATE statement being used in the trace.
Thanks, Sarah
This posting is provided "AS IS" with no warranties, and confers no rights. |