Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

counting and colliding licenses in db

counting and colliding licenses in db

counting and colliding licenses in db

I've got a list of clients in a table, with the number of licenses they're allowed to have and the number of licenses currently in use. I don't need to assign a unique license to a user, just as long as I ensure that there are not more users than licences allowed.

As soon as a new user starts the registration process, I need to increment the 'Licenses used' field, otherwise I might have collisions (such as two users vying for one remaining license). If that user fails to complete the registration process, I'll decrement the counter again, to make it available for the next user.

Here's my problem: since this is a web form, the user could, upon failing the registration, simply close his browser. Thus there is no "place" for me to know that they've failed. That counter has no reason to get decrmented.

I suppose I could time it, but that's so inelegant and over-engineered. More to the point, it is not user-transparent.

RE: counting and colliding licenses in db

Oops. So the question is:

How - or where - can I ensure that the counter gets decremented after reg failure? Or is there a better way to approach transactions and rollback?

I do NOT need a highly-engineered or high-security design, just enough to get the job done.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close