|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DB2 Sequence Advice Wanted |
« View previous topic :: View next topic » |
Author |
Message
|
jonesn |
Posted: Thu Mar 16, 2006 4:40 pm Post subject: DB2 Sequence Advice Wanted |
|
|
Apprentice
Joined: 09 Jan 2002 Posts: 47
|
Chaps,
I would be grateful for some advice on the use of sequence in my message flows. I am using WBIMB 5 FixPack 8 and DB2 8.2.
I have a message flow that processes messages from several sources. The message flow needs to perform sequence number checking on these sources. I am able to extract the sequence number from within each message. I am also able to determine the source for each message. Each source has its own sequence number. If a message arrives out of sequence I will do some exception processing. I am planning to use DB2 sequence objects to hold the expected sequence number for each source.
My questions are on how best to handle these sequence objects.
The first question is how to initialize the object in the first place. This is a broker that is going to intercept messages in an existing infrastructure so the sequence numbers for each source already exist & will be different for each source so I cannot start each at 1. Given the number of sources (about 200) it is not practical to stop all the systems, work out the current sequence number, manually create the DB2 sequence objects to match the next message for each source and then start the broker. I need a programmatic solution. I thought I could check to see if the sequence object for my source already exists and if not create one with the initial value set to the value in my message. Any sample code for this would be great. Another solution would be to have a table with a column of sources and another indicating that the sequence object has been created. Anyone got any opinions on these ideas or have other suggestions.
My second question is about where these sequence objects live in DB2. Is it possible to have a column of sequence objects in a table? The examples I have found suggest they are not associated with tables but if I could have such a column then this would logically group the objects and address my first question.
Thanks _________________ ---
Nick Jones
IBM Certified Solutions Expert (WebSphere MQ Integrator) |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 16, 2006 4:47 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
All you really need to do, right, is check to see if the sequence number for the current message is one larger than the last sequence number you have seen - right?
So create a single, two column table. column one is the id of the source. column 2 is the last sequence number you saw for that source.
If the last sequence number is empty, then the current sequence is okay.
Insert the current sequence after checking it against the previous sequence.
This assumes that sequence numbers must resume at the same place after a broker restarts.
If that is not the case - that you need to reset all your sequenece numbers at each broker restart, then you should use the Cache support pack instead of a database. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Thu Mar 16, 2006 4:52 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I don't think sequence objects are going to work out:
Quote: |
Other scenarios can cause gaps in a SEQUENCE, too. For example, issuing a ROLLBACK after acquiring a sequence number will not roll back the value of the sequence generator - so that value is lost. A DB2 failure can also cause gaps because cached sequence values will be lost. |
Is there no chance you can use Broker V6? There would be soooo... many more ways to do it then .... _________________ -wayne |
|
Back to top |
|
 |
sclarke |
Posted: Thu Mar 23, 2006 8:33 am Post subject: |
|
|
Apprentice
Joined: 05 Jan 2002 Posts: 39
|
Out of curiousity - what other options will there be in 6.0 that would survive a recycle? I am not using 6.0 yet and we do have a table that keeps track of sequence numbers and another to put the out of sequence messages so they can be processed when the sequence is recovered |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|