Skip to Content
0
Former Member
Jul 31, 2014 at 08:34 AM

Migrating from 15.0.3 64-bits to 15.7 64-bits

49 Views

We are upgrading our systems from Sybase 15.0.3 64.bits to 15.7 64-bits (Adaptive Server Enterprise/15.7/EBF 21984 SMP SP110 /P/RS6000/AIX 6.1/ase157sp11x/3546/64-bit/FBO.)  We are having trouble making 2 of 65 batch jobs work.  We use ctlib (Sybase CTISQL Utility/15.7/P-EBF20092 ESD #4/DRV.15.7.0.4/RS6000/AIX 6.1/BUILD1570-015/OPT/Thu)

We have assumed that 15.7 is upward compatible and have not changed our applications other than recompiling and linking with new libraries.

 


The error we are experiencing is that we somehow seem to loose our cursor.  There are no errors reported in the database logs and hence we assume that we receive an error from ctlib.  The error is happening often but we have also been able to run the two jobs without errors.  The jobs are retrieving and updating data in two databases on the same database server.

We have looked for solved errors and bug id 735036 seem to be somewhat similar but it says that this has been corrected in SP100 (we are running SP 110).

 

The structure of the code is like this:

Select rows from a table (in db1) with cursor

While still rows to be treated

                Fetch a row and get the data (10 rows fetched from the cursor at a time)

                Start transaction

                    do some more selects and updates (in db2) based on the information from the fetched row

                end transaction

                delete the row (in db1)

end while

The second time the fetch tries to read from the cursor, it has been closed.

Just to see what happened we replaced the DELETE with an UPDATE

It still failed using the UPDATE command but had fetched quite a few more rows than the DELETE command allowed us to do. (Using UPDATE it failed after 197 rows rather than 10).

This is the select statement setting up the cursor that fails:

SELECT TST_F4..TRANS_LINJE.TRANS_ID,TST_F4..TRANS_LINJE.TRANS_LINJE_NR,TST_F4..TRANS_LINJE.TRANS_STATUS,TST_F4..TRANS_LINJE.DATA_LINJE,TST_F4..TRANS_LINJE.LOCK_FLAG FROM TST_F4..TRANS_LINJE,TST_F4..TRANS T_O1 WHERE ((TST_F4..TRANS_LINJE.TRANS_STATUS=?)) AND ((T_O1.HOVED_AKT=? AND T_O1.TRANS_TYPE=? AND T_O1.TRANS_STATUS=? AND TST_F4..TRANS_LINJE.TRANS_ID=T_O1.TRANS_ID)) ORDER BY TST_F4..TRANS_LINJE.TRANS_ID,TST_F4..TRANS_LINJE.TRANS_LINJE_NR

Select with CURSOR


 

Anyone else experiencing similar problems?