rahul.kolhe22
30th January 2009, 12:01
Hi,
I am trying to trace one of the old code in which I came across the condition as shown below


...
db.retry.point()

select table1fields.*
from table1
where condition
selectdo
...
...
commit.transaction()
selecteos
...
...
commit.transaction()
endselect

db.retry.point()
select table2fields.*
from table2
where condition
selectdo
...
...
endselect

if no.error then
commit.transaction()
else
abort.transaction()
endif


Here when the first db.retry.point is been set, the control never goes in the first selectdo clause neither in selecteos. So nethier the commit nor the abort transaction is been executed.

After that other db.retry.point is been set. As far as I know we cannot set 2 db.retry.point without commiting or aborting the previous retry point.

Also the code I am tracing is very old and is in use and frequently executed, so there are no chances that it may be a bug.

Can anyone please let me know whether there is any variable or some debugger command or something similar using which I can know on execution of which statement the first db.retry.point is been unset/removed.

Any suggestions are welcomed.

Thanks in advance.

--Rahul

_Ralph_
30th January 2009, 15:10
You can use

db.retry.hit()

Return values

0 Retry point defined but not returned to.
>0 System returned to retry point.
-1 No Retry point defined
-2 Stack Error (Programming error in script. A db.retry.point() was done at a deeper stack level)


and in my opinion.. that is a bug xD

rahul.kolhe22
2nd February 2009, 06:46
Hi,
Thanks a lot Ralph for your immediate reply.

I think I have confused you.

The very first thing is that I am not supposed to make the changes in the script.
Secoundly, setting of two db.retry.point will give the fatual error. I can see the code executing in the debug mode but there is no fatual error. It means I am missing some thing somewhere.

So my problem is can anyone just help me out to know at which point (or execution of statement) the first retry point set is been unset/nutralized.

I want to know that while debugging is there any command which can help me to know that the retry point which is been set is been removed.

Thanks in advance

--Rahul

_Ralph_
2nd February 2009, 14:29
two db.retry.point() will show errors only if a db transaction(update, delete, insert) exists between. If there is nothing in between, no error should occur. As you are on LN mayber there is some transaction happening on DALs that you are not tracing.

I do not know anyway to know when the db.retry.point was hinted using the debugger.

toolswizard
2nd February 2009, 17:11
Unless there has been an actual transaction i.e. update, delete, I don't think you will get an error. If you do, it is usually a "transaction on" error.

The best way to test db.retry points is to use the bshell envrionment setting -set TEST_RETRY=1. This wil allow you to test the code to make sure it is running the second time the same as the first. So when ever you hit a transaction, or commit transaction, it will always fail once, and then recover.

If you want to force a fatal error, set the retry count greater than the max retry limit. 11 usually works.

rahul.kolhe22
3rd February 2009, 11:28
Hi,
Thanks a lot Ralph and William.

William your idea to trace db.retry.point was superb. It helped me. Also Ralph your information was really usefull.

Thanks again

Regards,
--Rahul