Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
s_grosskr
Posts: 26
Joined: Fri 31 Aug 2007 13:14

Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by s_grosskr » 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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by AlexP » Wed 12 Aug 2015 06:09

Hello,

Thank you for the sample, we have reproduced the described problem and will investigate the reason for such behavior.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by AlexP » Thu 03 Sep 2015 13:21

We have already fixed the problem. The fix will be included in the next version, which will be released the next week.

s_grosskr
Posts: 26
Joined: Fri 31 Aug 2007 13:14

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by s_grosskr » Fri 04 Sep 2015 07:02

Thanks for the good news.
Looking forward for the next release ...

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by AlexP » Fri 04 Sep 2015 07:10

You are welcome.

s_grosskr
Posts: 26
Joined: Fri 31 Aug 2007 13:14

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by s_grosskr » Mon 14 Sep 2015 09:08

Hello again,
I just tried your new release 9.6.19 and there is good and bad news:
When I run the test in local mode, (LocalUpdate := True), everything is fine, I don't get the "TOraClob.Free RefCount = 0" Assertion anymore.
But when I run the test with LocalUpdate := False (Checkbox "keep changes local' is unchecked), I get a key constraint error when I run the test.

Hint: To run the test properly it's necessary to uncheck the checkbox *before* pressing "Start".
I send you (alex_p) a new version of my test, where this checkbox works in the desired way, so you can really toggle between "local" and "write"-mode.
Could you please have a look at the example and confirm this error?

Thanks for you efforts.
With regards
Stefan "ostijo" Grosskreutz

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by AlexP » Mon 14 Sep 2015 10:10

Thank you for the sample, we have reproduced the described case, and will fix it as soon as possible

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Error, when filtering a CLOB field and posting changes that excludes the row from the filtered dataset

Post by AlexP » Mon 14 Sep 2015 10:10

Thank you for the sample, we have reproduced the described case, and will fix it as soon as possible

Post Reply