Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset
Posted: Tue 11 Aug 2015 14:37
Hi Dear ODAC Support Team,
I've found another problem with ODAC Datasets and CLOB fields.
As usual I send a sample app that demonstrates the problem to alex_p at devart.
I have a TSmartQuery, that loads data containing a CLOB field.
Then I apply a filter on that CLOB field.
Now I change the value of that field so that it doesn't match anymore with the
filter condition.
When I post the record, ODAC seems to make a duplicate of the original record.
You can test this, if you uncheck the checkbox "keep changes local", you get
a primmary key constraint error on table EMP then.
When you keep changes local, you should get a "TOraClob.Free RefCount = 0" Assertion
in MemData.pas line 8933 on closing the dataset.
I work with the latest ODAC version (9.5.18).
The duplicated row can be seen in my real application as well:
I have a Tree bound to such a datasource and when I clear the filter, I can
see a duplicate of the changed data row.
Interestingly the recordcount is still the old, so I think there is something
going wrong internally.
The error shows up only when filtering a CLOB field. When I apply the filter on a
VARCHAR field, everything is ok. You can test this by unchecking the
checkbox "Filter CLOB-Field". The filter is then applied to the field JOB.
My demo application uses the EMP table from the scott/tiger sample schema and
adds a CLOB field (CLOB_TEST) as a copy of the JOB field.
Just use the button "Create CLOB Field" to create the field and the
button "Drop CLOB Field" when you're done with the test.
And of course you have to change the constant myServer.
Thanks for your help.
With regards
Stefan "ostijo" Grosskreutz
I've found another problem with ODAC Datasets and CLOB fields.
As usual I send a sample app that demonstrates the problem to alex_p at devart.
I have a TSmartQuery, that loads data containing a CLOB field.
Then I apply a filter on that CLOB field.
Now I change the value of that field so that it doesn't match anymore with the
filter condition.
When I post the record, ODAC seems to make a duplicate of the original record.
You can test this, if you uncheck the checkbox "keep changes local", you get
a primmary key constraint error on table EMP then.
When you keep changes local, you should get a "TOraClob.Free RefCount = 0" Assertion
in MemData.pas line 8933 on closing the dataset.
I work with the latest ODAC version (9.5.18).
The duplicated row can be seen in my real application as well:
I have a Tree bound to such a datasource and when I clear the filter, I can
see a duplicate of the changed data row.
Interestingly the recordcount is still the old, so I think there is something
going wrong internally.
The error shows up only when filtering a CLOB field. When I apply the filter on a
VARCHAR field, everything is ok. You can test this by unchecking the
checkbox "Filter CLOB-Field". The filter is then applied to the field JOB.
My demo application uses the EMP table from the scott/tiger sample schema and
adds a CLOB field (CLOB_TEST) as a copy of the JOB field.
Just use the button "Create CLOB Field" to create the field and the
button "Drop CLOB Field" when you're done with the test.
And of course you have to change the constant myServer.
Thanks for your help.
With regards
Stefan "ostijo" Grosskreutz