So after much discussion I finally sat down and had to figure out the transaction processing on interactive applications.
A little over two years ago we were working on a project and I had to make sure everything, i.e., Business Functions and Table I/O were included or failed as one transaction. We were on Tools Release 8.96 at the time and it was as simple as setting the Transaction form property and then putting everything inside the Ok button events.
We moved to 8.98.x at the first of 2009 and some developers were complaining that they couldn't get the stuff to work. My reply was always..check APPL X, it works there. I guess I probably sounded like some old guy, 'it worked when I was a kid!' Today it came to a head and one of the developers was finally calling me out, it doesn' work on APPL X. I didn't believe him, of course it worked, I built it myself. Well he turned out to be right, the transaction boundary had changed. Now the only place you can call Cancel User Transaction is within the Post Button Clicked event. Things have changed since the good ol' days of 8.96, forward progress.
The process we used to test,
1. Create a Fix/Inspect or Power Edit.
2. Check Transaction on the form property.
3. Open Ok button Event Rules
4. Select Post-Button Clicked Event
5. Open Table clicking Advanced button selecting the Include in transactions.
6. Perform Table I/O.
7. Check for SV File_IO_status errors.
8. If there are errors call system function Cancel User Transaction.
9. Close all tables.
It really is that easy and if you want to include any business functions, all you need to do is make sure that you are including them in the transaction as well.
Hope this help as it was a mystery for some time and I finally had a moment to solve it.
A little over two years ago we were working on a project and I had to make sure everything, i.e., Business Functions and Table I/O were included or failed as one transaction. We were on Tools Release 8.96 at the time and it was as simple as setting the Transaction form property and then putting everything inside the Ok button events.
We moved to 8.98.x at the first of 2009 and some developers were complaining that they couldn't get the stuff to work. My reply was always..check APPL X, it works there. I guess I probably sounded like some old guy, 'it worked when I was a kid!' Today it came to a head and one of the developers was finally calling me out, it doesn' work on APPL X. I didn't believe him, of course it worked, I built it myself. Well he turned out to be right, the transaction boundary had changed. Now the only place you can call Cancel User Transaction is within the Post Button Clicked event. Things have changed since the good ol' days of 8.96, forward progress.
The process we used to test,
1. Create a Fix/Inspect or Power Edit.
2. Check Transaction on the form property.
3. Open Ok button Event Rules
4. Select Post-Button Clicked Event
5. Open Table clicking Advanced button selecting the Include in transactions.
6. Perform Table I/O.
7. Check for SV File_IO_status errors.
8. If there are errors call system function Cancel User Transaction.
9. Close all tables.
It really is that easy and if you want to include any business functions, all you need to do is make sure that you are including them in the transaction as well.
Hope this help as it was a mystery for some time and I finally had a moment to solve it.
No comments:
Post a Comment