Sometimes updating of CLOBs with strings longer than 4000 fails with ORA-01704

74 views
Skip to first unread message

Raimonds Simanovskis

unread,
Dec 2, 2013, 9:58:09 AM12/2/13
to oracle-...@googlegroups.com
I need your help to debug strange oracle_enhanced issue.

I am using oracle_enhanced adapter version 1.4.2 in my packaged eazyBI application which is distributed to many clients.

In couple client installations I am getting strange error that update of ActiveRecord model with CLOB column with string longer than 4000 characters results in ORA-01704 error. It is because UPDATE statement is generated with string literal longer than 4000 characters. But normally if CLOB column is detected as ActiveRecord :text column then in UPDATE statement it should be quoted as empty_clob() (see https://github.com/rsim/oracle-enhanced/blob/v1.4.2/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L454) and then CLOB value should be updated in a separate callback. But in the case of these couple client installations for some reason it is not happening.

I saw oracle_enhanced issue https://github.com/rsim/oracle-enhanced/issues/344 with similar error. I was wondering if anyone else has experienced this issue?

I suspect that in these cases for some reason these ActiveRecord model CLOB columns are not detected as :text columns. Probably SELECT from data dictionary tables (https://github.com/rsim/oracle-enhanced/blob/v1.4.2/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L1079-L1093) is returning something else than expected.

As I do not have direct access to these remote client installations it is hard for me to debug this issue. If anyone else has experienced similar issue please share what was causing this.

Kind regards,
Raimonds
Reply all
Reply to author
Forward
0 new messages