our invoice number is sequential (i.e. new invoice number = previous invoice number + 1). A simple subprogramm (running for many years) does the job as an invoice number generator.
get counter-view #ISN add 1 to counter-view.counter update
The calling program has to do the end/backout transaction. And that’s the problem. Not every calling program ends the transaction immediately. Sometimes that leads to deadlocks, NAT3009 etc. To do the end transaction inside the subprogram won’t work because it influences the transaction logic of the calling program.
So the question is: How to solve the problem?
Adabas/Natural is not able to handle nested ETs or something like that.
One idea is to call the invoice number geneator as a RPC-Program (btw: is it possible to call a local Subprogram via RPC?). It has a different Adabas-Session and so we could to an ET inside the subprogram without influencing the calling program. Any other ideas?