Sequential numbers without a database?

Discussion in 'ASP .Net' started by Mike Kingscott, Jul 1, 2004.

  1. Hi all,

    I'd building an app that posts to a web service. One of the things
    that is required in the soap header is a sequential number appended to
    a ref, i.e. "IGI1001", "IGI1002", etc.

    Obviously the first part of the reference ("IGI") stays the same, but
    I need an incrementing number generated. Now, I was thinking of doing
    this via a SQL database, but it would be an awful waste as there would
    only be one table and one stored procedure in it. Then I was thinking
    of putting it in an application variable: it would be read from a file
    at the application start, incremented through the life of the
    application, then written back to the file at application end. I
    quickly discounted that in case the new number didn't get written back
    to the file for whatever reason.

    Incidentally, the web service expects the caller to provide the
    incrementing alpha-numeric reference, so it won't be done at the web
    service.

    Any thoughts?

    Kind regards,

    Mike Kingscott
     
    Mike Kingscott, Jul 1, 2004
    #1
    1. Advertising

  2. Hallo Mike
    "Mike Kingscott" <9.co.uk> schrieb im Newsbeitrag
    news:...
    > Hi all,
    >
    > I'd building an app that posts to a web service. One of the things
    > that is required in the soap header is a sequential number appended to
    > a ref, i.e. "IGI1001", "IGI1002", etc.
    >
    > Obviously the first part of the reference ("IGI") stays the same, but
    > I need an incrementing number generated. Now, I was thinking of doing
    > this via a SQL database, but it would be an awful waste as there would
    > only be one table and one stored procedure in it. Then I was thinking
    > of putting it in an application variable: it would be read from a file
    > at the application start, incremented through the life of the
    > application, then written back to the file at application end. I
    > quickly discounted that in case the new number didn't get written back
    > to the file for whatever reason.
    >
    > Incidentally, the web service expects the caller to provide the
    > incrementing alpha-numeric reference, so it won't be done at the web
    > service.
    >
    > Any thoughts?
    >
    > Kind regards,
    >
    > Mike Kingscott


    I think, wether it is a waste, to use a sql database. its the safest way to
    ensure there is always an incremented number.

    regards benni
     
    Benjamin Bittner, Jul 1, 2004
    #2
    1. Advertising

  3. Mike Kingscott

    Scott Allen Guest

    Any chance you could use a timestamp, or a GUID in the headers to make
    them unique? Or does it absolutely have to be a sequential number?

    Perhaps you could use a combination of incremented number and a
    TimeStamp. The TimeStamp could be the time at which the application
    started, say with DateTime.Now.Ticks. The sequential ID could then be
    a static field that you increment with the Interlocked.Increment
    method.

    Possible?

    --
    Scott
    http://www.OdeToCode.com


    On 1 Jul 2004 03:25:58 -0700, 9.co.uk (Mike Kingscott)
    wrote:

    >Hi all,
    >
    >I'd building an app that posts to a web service. One of the things
    >that is required in the soap header is a sequential number appended to
    >a ref, i.e. "IGI1001", "IGI1002", etc.
    >
    >Obviously the first part of the reference ("IGI") stays the same, but
    >I need an incrementing number generated. Now, I was thinking of doing
    >this via a SQL database, but it would be an awful waste as there would
    >only be one table and one stored procedure in it. Then I was thinking
    >of putting it in an application variable: it would be read from a file
    >at the application start, incremented through the life of the
    >application, then written back to the file at application end. I
    >quickly discounted that in case the new number didn't get written back
    >to the file for whatever reason.
    >
    >Incidentally, the web service expects the caller to provide the
    >incrementing alpha-numeric reference, so it won't be done at the web
    >service.
    >
    >Any thoughts?
    >
    >Kind regards,
    >
    >Mike Kingscott
     
    Scott Allen, Jul 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. john

    Sequential Machines

    john, Oct 28, 2004, in forum: VHDL
    Replies:
    6
    Views:
    650
    rickman
    Nov 5, 2004
  2. Taras_96
    Replies:
    5
    Views:
    2,263
    Taras_96
    Apr 14, 2005
  3. john
    Replies:
    7
    Views:
    720
  4. =?iso-8859-1?b?Sulq6Q==?=

    [EXCEL] sequential =?iso-8859-1?q?acc=E8s=2E?=

    =?iso-8859-1?b?Sulq6Q==?=, Jan 23, 2004, in forum: Perl
    Replies:
    0
    Views:
    735
    =?iso-8859-1?b?Sulq6Q==?=
    Jan 23, 2004
  5. Ken
    Replies:
    1
    Views:
    108
    Jeff North
    Feb 13, 2004
Loading...

Share This Page