Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence Table
Well here is some more info.
(for those interested the wireless link is the Cingular Data Network, what
blackberry runs on)
Right now I have a send table that is:
UNITID NUMBER(8,0)
SEQNUMBER NUMBER(3,0)
TIMESTAMP DATE/TIME
MESSAGE LONG RAW RETRIES NUMBER(1,0)
UNITID,SEQNUMBER is the primary key. TIMESTAMP represents the time to send the message(which can be in the future). I send the message out over a wireless link and wait for a response which is either positive if delivered or negative if the unit could not be found because it was out of coverage. MESSAGE contains the UNITID and SEQNUMBER in it also. When I receive a positive or negative ack, I can take the UNITID and SEQNUMBER from the message to update the table. Positive ACKS causes the row to be deleted. When negative response, I increase the TIMESTAMP by 2 minutes so that it will try again to deliver it. SEQNUMBER is just a number between 0-2047. The mobile asset uses these SEQNUMBER to make sure that the message is new and not just a duplicate message to deal with. We probably will only send maybe 250 messages a month per mobile asset a month.
Right now I have been storing the Sequence number in my C++ program in a Hashtable, but now I have to have a central place for the sequence number, since now a website can be adding to the send queue which is the above table.
"Jason Webber" <webber_at_mminternet_spam.com> wrote in message
news:u8drov2ja44k82_at_corp.supernews.com...
> I need a way to have a sequence for a given amount of mobile assets for a
> messaging system. Each message gets assigned a sequence number. Each
> mobile asset needs to have its own sequence to get the next number from.
I
> don't think creating a sequence object for each mobile asset sounds
> appropriate in this case since I would have to create a new sequence each
> time I add a mobile asset. Right now there could very easily be 500,000
of
> these mobile assets. I thought of just creating a table, with a varchar2
> being a unique descriptor of a mobile asset and another column
representing
> the sequence number. Is there a better way to do this so that two
threads
> in my application that are running and try to get the next sequence number
> don't end up with the same number.
>
> TIA
>
>
Received on Thu Mar 07 2002 - 09:49:16 CST
![]() |
![]() |