473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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 7674
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.