setjmp()/longjmp() and RDS
Posted in 1995
Topics: Installation, Setup & Upgrades, Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
To all IPC and Trigger-Fans!
Our Configuration and installation-order:
SCO 3.2.4
Informix SQL 4.11.UC1
Informix RDS 4.11.UC1
Informix ID 4.11.UC1
Informix Online 5.01.UD2
Please have a look at the following scenario:
1. There is a table called `lager' representing the real-world stockroom
(german Lager).
In this stockroom is beside others the article `screw' and the actual amount.
2. There is a module which allows a user to create a delivery note (german
Lieferschein).
3. The user X now wants to sell and deliver some amount of screws. So we select
and display the actual amount from the table `lager' that the user can decide
wether he's able to sell the whole amount or not.
4. While the user X has the information on the screen and the purchaser at the
telefon, he decides that the amount of this article the purchaser wants to buy
is enough.
5. While speaking with the purchaser, user Y unfortunately sold the whole
amount of the screws.
6. At the moment user Y's process updates the table `lager', we want user X
to inform about the change. We want to tell him immediately, that the
information on the screen is no longer valid.
And now the big question is:
WHAT IS THE MOST-EFFECTIVE AND EASIEST-TO-IMPLEMENT STRATEGY TO IMPLEMENT
THIS `Real-Time'-Database-Applikation with RDS?
There are several starting points, we think:
1. We heard and read something about `triggers', which are said to be related
to tables. But all we found in the whole documention of our products was a
short hint in the release notes that there should exist two commands
CREATE TRIGGER and DROP TRIGGER, but nothing (in words: NOTHING) about thesyntax of these statements.
The question here is: Where can we get information about the syntax and
usage of the triggers-mechanism?????
2. We have some experience with the C-function-pair setjmp()/longjmp() and
so we think it should be possible to implement a complex mechanism like the
following:
a) With a C-routine holding a sigaction()- and a setjmp()-call we activate
the listening to a userDefined signal before selecting and displaying the
`lager'-information.
b) On receive of the userDefined signal, the other with sigaction() specified
C-routine executes the longjmp()-call so that a error-statement could inform
the user about a change of the amount of screws before selecting and displaying
this information again.
c) After every update of the table `lager', there should be a call to a
C-routine which sends the userDefined signal to every database-process (via
a call to the kill()-function after examining the process-table).
d) Upon leaving the delivery note - module, the listening to the userDefined
signal must be deactivated due to another sigaction()-call.
The questions here are:
1. Could the implementation be done without setjmp()/longjmp()???
2. DO THESE C-routines AND THE RDS-Interpreter work together in the outlined
way???? or is it completely impossible for both to comunicate in this
asynchronous manner????
So long,
Richard
--
Richard Bahcic Email: rb@argon.in-ulm.de