473,503 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sequence Number generator on the server



Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
4 7690
You can send the client a set of numbers to use (Lease) for transactional
purposes
and they can run through them. They can get new numbers as they need them. Are
these being used to identify connections? If so, then there are a number of
security
holes with your design. The transaction ID's can be modified by a simple client
ID
that is assigned at the server level. That way client's can issue a normal 16
bit ID,
you assign an additional 16 bits based on a client ID and that generates a new
unique
transaction ID. The client doesn't even need to know it's client ID because that
information
is associated with the socket on the server side.

You mention not using ASP, so this should be really easy in a socket based
application.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Kamran K" <an******@yahoo.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...


Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2
You can send the client a set of numbers to use (Lease) for transactional
purposes
and they can run through them. They can get new numbers as they need them. Are
these being used to identify connections? If so, then there are a number of
security
holes with your design. The transaction ID's can be modified by a simple client
ID
that is assigned at the server level. That way client's can issue a normal 16
bit ID,
you assign an additional 16 bits based on a client ID and that generates a new
unique
transaction ID. The client doesn't even need to know it's client ID because that
information
is associated with the socket on the server side.

You mention not using ASP, so this should be really easy in a socket based
application.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Kamran K" <an******@yahoo.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...


Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #3
Could you use GUIDS?

They were designed to provide the functionality you need.

"Kamran K" <an******@yahoo.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...


Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #4
Could you use GUIDS?

They were designed to provide the functionality you need.

"Kamran K" <an******@yahoo.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...


Hello
I have created a client server application using C#. Existing
application is using random number on client side to generate sequence
numbers that are then assigned to transactions. This results in
duplicate sequence numbers across multiple users.

Solution to this problem is to generate the sequence number on the
server. Since this is not an ASP app, I cannot use Global.asax
Application object to keep track of begin application.

I would like to do this without hitting the database or use file system
to store and read numbers.

I would appreciate if anyone can help me with creating a sequence number
generator that would not result in duplicate numbers across multiple
users.

Thank You

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1391
by: James Liu | last post by:
I did some search and didn't find anything about whether Yokon will support sequence object. Appreciate it if you can reply with some resources. Thanks, James
3
7785
by: pluton | last post by:
Hallo, Hot to get unique, sequential number during execution of stored procedure ? I can create table with autoincrement column, add record, get ident_current and delete record each time i...
4
1845
by: Nel | last post by:
Hi all, I am driving myself crazy trying to think of a solution to this - perhaps one of you guys can see a simple solution. The problem is displaying the contents of an array in what appears...
2
2506
by: Ken | last post by:
I got an Access database that need to be converted to Oracle 9i. Somehow the Trigger we created to simulate the "AUTO NUMBER" on Access could not create the sequence number as soon as the value has...
0
419
by: Kamran K | last post by:
Hello I have created a client server application using C#. Existing application is using random number on client side to generate sequence numbers that are then assigned to transactions. This...
4
538
by: Eric E | last post by:
Hi, I have a question about sequences. I need a field to have values with no holes in the sequence. However, the values do not need to be in order. My users will draw a number or numbers from...
12
5197
by: Jim Michaels | last post by:
I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's...
28
3017
by: Rob Cowie | last post by:
Hi all, I wish to generate a sequence of the form 'aaa', 'aab', aac'.... 'aba', 'abb', 'abc' etc. all the way to 'zzz'. How would you construct a generator to acheive this? A simple,...
6
15020
by: newtophp2000 | last post by:
Hello, Since SQL Server has no sequence generator, I wrote my own. (I claim no ownership of it as it is closely modeled after earlier discussions on this topic.) I have included the sql...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.