Read config/sequence from database

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, the BCI functions are agnostic about what ODBC driver you use. Whatever driver you use, though, it must be properly configured and a DSN entry (with DBMSTYPE = ODBC) must exist in the uvodbc.config file for your project.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
cwong
Charter Member
Charter Member
Posts: 26
Joined: Tue Apr 30, 2002 8:02 am
Location: Canada

Post by cwong »

Yes, the sequence number of each "key" will be similar to the sequence number in, i.e. Oracle. The structure of the hash file contains: Key Name, Sequence value. For example, if customer number is sequentially assigned, there may be a "key" Name: Cust_Num with an initial value of 0 to start.

There is no need to pre-define or to prepare the entry into the hash file prior to its usage. The routine detects if this is the first time calling this "key", it will take care of the insertion rather than updating.

Every time when the routine is called with the specific "key" name, it will perform the advancing logic, update and return the next value. The routine can be called in any jobs in the same project which may be running concurrently and accessing the same "key".
Note that if the same "Key" hash file is to be shared across projects, modification to the supplied routine will be required.

Also, any time, if necessary, may use a job to synchronize the sequence value in the hash file with the value in database, i.e. sequence number = select Max(cust_num)from customer.

Hope this help ... [:)]



cwong
cwong
Charter Member
Charter Member
Posts: 26
Joined: Tue Apr 30, 2002 8:02 am
Location: Canada

Post by cwong »

Under sdk, there are 2 key mgmt routines. The one for concurrent env. is built to support multiple access via read locking and write unlocking.
In simple sense, when 2 jobs are going for the same "key" via the concurrent routine, one will get the next value and the other one will get the next of next value. [:)]

cwong
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It doesn't matter where you're doing it. If two processes want to access a server of some kind (whether a hashed file, a routine, a server process or whatever) to obtain the next value in the same sequence, that server mechanism must be single-threaded. Most usually this is accomplished via locks of some kind, and unavoidably introduces a bottleneck in througput.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply