Click here to Skip to main content
12,950,618 members (58,900 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 10 Dec 2003

Mutex Solution in ASP

, 10 Dec 2003
Rate this:
Please Sign up or sign in to vote.
ASP code for generating unique IDs


This article is intended to solve the mutex problem, arising in huge websites, where a lot of information for each session user has to be unique. Here the solution for the  mutex problem is done using the ASP web technology. The same logic can be implemented in other technologies also. In fact this solution can even be implemented in client server applications.


In a huge web application thousands of users log-in, and log-out in a hour from all over the world. Now, we some times need to provide them a unique ID instead of just a sessionID, and this cannot be done using any feature in IIS. Say, if we want to give them a unique ID for a table, then it is difficult to use the application.lock method, and then we need some extra mechanism to generate a unique ID. See Global.asa from the downloadable zip for details on how I have implemented the unique ID generation.

Sample Usage



  • December 12 2003 - First version


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Team Leader
United States United States

Around six years of experience in Software Engineering, system Developments, and Integrations.

Programming Languages: C#, VB.NET, ASP.NET, ASP, VB.

Database: SQL-Server 2005/2000/7.0, My-Sql.

Middle Tier: XML, MQ-SERIES

Operating Systems: IIS (3.0, 5.0, 6.0), APACHE (1.3-2.0)

Vista Gagdget, Widows SharePoint

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
CoolVini6-Feb-09 13:52
memberCoolVini6-Feb-09 13:52 
GeneralRe: My vote of 1 Pin
Himadrish Laha18-Apr-09 21:23
memberHimadrish Laha18-Apr-09 21:23 
QuestionWhat's the point? Pin
Vince C.16-Dec-03 0:51
memberVince C.16-Dec-03 0:51 

"Simplest things generally are the best" is what I often try to recall while doing things (not only when coding). I must admit I didn't quite catch your point against using Session.SessionID, for instance.

As I understood your method relies on Session to be triggered. When triggered, a fuction call returns a new ID. Basically this means you get a new ID on every session, right? Which is exactly what SessionID does.

Both share the same disadvantages, e.g. SessionID uniqueness is not guaranteed for a single visitor (i.e. while unique since last IIS start a visitor might get different SessionIDs). Both ways also require browsers to accept cookies, which might not always be true.

Could you provide detailed explanation on your method? What is "the problem" you want to solve?

IMHO it is best to use integrated security to login users. There are some articles on MSDN that deal with it be it using SSL or other secured channels.


Vince C.

AnswerRe: What's the point? Pin
Himadrish Laha16-Dec-03 1:15
memberHimadrish Laha16-Dec-03 1:15 
GeneralRe: What's the point? Pin
Vince C.16-Dec-03 10:21
memberVince C.16-Dec-03 10:21 
GeneralCan't understand... Pin
denic15-Dec-03 5:11
memberdenic15-Dec-03 5:11 
GeneralRe: Can't understand... Pin
Himadrish Laha16-Dec-03 1:23
memberHimadrish Laha16-Dec-03 1:23 
Generalzip file empty Pin
msyoung15-Dec-03 4:14
membermsyoung15-Dec-03 4:14 
GeneralRe: zip file empty Pin
Himadrish Laha16-Dec-03 1:25
memberHimadrish Laha16-Dec-03 1:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 11 Dec 2003
Article Copyright 2003 by Populate123
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid