473,385 Members | 1,379 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,385 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 7666
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.