Solved TD-22596: SqlResultSet True and Long bound crashes

Post found bugs and possible workarounds.
MWegner
Germany
Posts: 83
Joined: 11 Apr 2017, 07:39
Location: Germany

TD-22596: SqlResultSet True and Long bound crashes

Post by MWegner » 02 Dec 2015, 13:18

Hey TD Team,

if you set SqlResultSet to TRUE and select more then 65536 rows with a long string TD crashes with no message.

I can only provide a reprocase with no data, so you need to modify the function f1 ('DATABASE' + 'USER' + 'PASSWORD' + Sql-Statement ) and use one of your own databases.

Thanks in advance for any answers, help and suggestions.

For the moment we set SqlResultSet to FALSE, but it's not ideal.

Enviroment: TD63 and TD624, Oracle Database, Win7 64bit

Best regards
Martin
You do not have the required permissions to view the files attached to this post.
Last edited by Anonymous on 15 Dec 2015, 08:00, edited 1 time in total.

Mike Vandine

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by Mike Vandine » 03 Dec 2015, 06:59

Hi Martin,

I'll get this looked at!

Best regards,

Jean-Marc Gemperle

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by Jean-Marc Gemperle » 09 Dec 2015, 09:33

Hi,

Could you please test the same using LOB instead of LONG?

The reason I ask is because since ORACLE 8i ORACLE has announced deprecation of LONG/LONG RAW in there next versions see
https://docs.oracle.com/cd/A91202_01/90 ... p.htm#6690
http://stackoverflow.com/questions/1283 ... -in-oracle

Since ORACLE 8i, we have fixed issues related to LONG, but performance issues exist...
So the recommendation is to move to LOB/CLOB ...it is more than a recommendation.

I'm not convinced though this is the reason of the crash because FERS Front End Result Set uses temp file to store result set and the limit we have is 2GB, 65535 rows is not that much but it depends of course on the volume of the data...so wonder in your case if it depends on the volume of the data...

So please let us know if with LOB you still get the crash.

JM

Jean-Marc Gemperle

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by Jean-Marc Gemperle » 10 Dec 2015, 14:12

Hi

Saying to use CLOB instead of LONG is something...and right but would it be fine? would it crash?
So I try a simple test and did not have any crash 6.3 SP1.
Inserting 100000 rows in a CLOB of 300 chars.
You can see the FERS file in my profile temp folder and SqlResultSetCount() returning the right amount of rows.
Attached snapshot / test APP. The test APP is something I re-used so kind of not nice but I believe shows it works.
Please try it, modify it if it does not reflect fully what you do

cheers
JM
You do not have the required permissions to view the files attached to this post.

MWegner
Germany
Posts: 83
Joined: 11 Apr 2017, 07:39
Location: Germany

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by MWegner » 14 Dec 2015, 08:54

Hey JM,

thanks for you answer. I've tested my code with clob field in the database and got the same results. So error still exists.

Is there a guide or something how to move to clob? Or is it just a database thing and I don't have to change anything in my project?

Best regards
Martin

Jean-Marc Gemperle

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by Jean-Marc Gemperle » 14 Dec 2015, 09:20

HI Martin,
"Is there a guide or something how to move to clob?"
I believe the stackoverflow link that I gave mentioned about the ease to migrate from long to LOB but honestly I don't know.
I'm sure a ORA DBA should know about tools that allows to do that with ease.
Actually I found an ORACLE link
https://docs.oracle.com/cd/B19306_01/ap ... ng_lob.htm

I've tested my code with clob field in the database and got the same results. So error still exists.
From my attached sample I did not have any problem with 300chars*100.000 rows with FERS enabled.
Does the test that I attached crash on your side, if not we need to know that is the difference. I used TD 6.3 SP1.

So please check my testcase.

HTH

JM

MWegner
Germany
Posts: 83
Joined: 11 Apr 2017, 07:39
Location: Germany

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by MWegner » 14 Dec 2015, 12:39

Hey JM,

thank you for the provided links. Your reprocase did not crash for me either. I changed it a little bit and could reproduce the error again.
I marked my changes with ! Changed.

Best regards
Martin
You do not have the required permissions to view the files attached to this post.

Jean-Marc Gemperle

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by Jean-Marc Gemperle » 14 Dec 2015, 15:31

Hi,

Yes the issue is not CLOB vs LONG or even the size of the DATA in the FERS but crash at 65365 on the fetch next.
I believe ORACLE might not be the only DB supported with the ISSUE...

65535 seems to be a limit but there should not be such limit in any case TD should not crash. Without FERS no problem and more interestingly if calling SqlResultSetGetCount() before the FETCH then the crash does not happen because the FERS file will get ALL its records in one go as opposed to SqlFetchNext() appending data per fetch() in the FERS file. This can be seen in the TEMP appdata of the user profile.

So you calling SqlResultSetGetCount() before the fetch might be a workaround? of course you will see a lag the time FERS file gets populated justg before getting the result on SqlFetchNext()

Better testcase IMO attached

The CRASH defect

TD-22596

JM
You do not have the required permissions to view the files attached to this post.

MWegner
Germany
Posts: 83
Joined: 11 Apr 2017, 07:39
Location: Germany

Re: TD-22596: SqlResultSet True and Long bound crashes

Post by MWegner » 15 Dec 2015, 08:00

Thanks for working this out with me and logging a defect.

Sadly SqlResultSetGetCount() is not an option. We can't use this function, because we have trouble with it in a constellation of TD20 and MsSql 2012 (same codebase).

We helped ourself with deactivating SqlResultSet for big selects with long/clob columns.

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 1 guest