nopadon
28th February 2003, 06:16
Could you please give a example code about Abort.transaction.?

What's abort.transaction ?

If I update 2 Table and Insert 3 Table , abort.transaction will be cancels (Not update 2 Table and Not Insert 3 Table).

If I wrong , please change it to correct.

How to coding ?



Thanks and Regards

Nopadon
28 March 03

NPRao
28th February 2003, 08:41
Refer to - abort.transaction() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_db_operations_abort_transaction) and Transaction handling (http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_transaction_handling)

nopadon
28th February 2003, 08:58
Could you give simple coding to make me clearly ?

need you help and advice.

Thanks and Regards
Nopadon
28 Feb 03

zardoz
28th February 2003, 13:06
when you put db.retry.point() in a script, all transactions are done (committed) when the flow encounters a commit.transaction() instruction. All transaction are negate by putting an abort.transaction() instead.
I have also a note on differences about using TBASE and other DB like ORACLE.
If you are using TBASE, all the transactions are done directly (you can look at the transactions using general table maintenance); when the commit.transaction() is done, in fact TBASE doesn't nothing; if a abort.transaction() is done, TBASE deletes all the transactions.
If you are using ORACLE, all the transaction are buffered in ORACLE but are not visible in general table maintenance: when the commit.transaction() is done, all the buffered transactions are effective, if the abort.transaction() is done, all the buffered transactions are uncommitted.

....
db.retry.point()
ppmmm999.fld1 = x1
ppmmm999.fld2 = x2
.....
ppmmm999.fldN = xN
db.insert(tppmmm999, db.retry)
....
select ppmmm999.*
from ppmmm999
where ppmmm999.fld1 = x1
selectdo
.....
endselect
.....
commit.transaction()
....

This works only if you use TBASE and not in ORACLE!