We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,451 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Auto Number Generation Problem

I have developed a web appication for Hospital which manages Patient Information.
When the web application is simultaneously opened on more than one machine.
While filling data on one machine it redirect to next page which autogenerates SID.
but when user at the same time try to fill data from another machine it generates same ID and while filling data.
it says ID already exist and give server error.
How can more than one user work simultaneously.
Kindly Suggest the same.

2
Contributors
1
Reply
5 Days
Discussion Span
4 Months Ago
Last Updated
2
Views
Arjun_Sarankulu
Junior Poster
169 posts since Jan 2011
Reputation Points: 7
Solved Threads: 1
Skill Endorsements: 0

One option is to let the database (assuming you use one) handle the ID generation. Basically, you let the user enter all of the information, then let the database assign an ID when it is inserted into the table. This can be utilized by many database engines with a simple keyword when creating or altering a table (i.e. IDENTITY for SQL Server, AUTO INCREMENT for MySQL, etc.). Modern database engines can generally handle concurrent database access quite well. See here for more info.

nmaillet
Posting Pro
537 posts since Aug 2008
Reputation Points: 111
Solved Threads: 103
Skill Endorsements: 4

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0575 seconds using 2.7MB