Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6736279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:40+00:00 2026-05-26T11:06:40+00:00

Here’s a scenario: There are users, users have skills. If a user specifies new

  • 0

Here’s a scenario:
There are users, users have skills. If a user specifies new skill, it needs to be added, however if user specifies existing skill – it should link to the existing one.
So, setup is pretty basic – 3 tables (users, skills, userSkillsLink). It’s a web app, but I don’t want to add every skills there’s in a drop down – so I won’t know if skill exists right away. I could check if skill already exists using select, but in web app that’s not the best choice – not thread safe.
I can keep a track of which skills already exist in a separate cache, but this problem should be.. very common, so I’m thinking maybe I’m over-complicating, and there’s a known solution already.

Thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:06:41+00:00Added an answer on May 26, 2026 at 11:06 am

    I think the proper way to solve this with transactional semantics is:

    • Make the potentially shared value the primary key of its table so it is guaranteed to be unique
    • Query to populate the dropdown and store the results in a local cache
    • If the record exists in the cache, reuse it
    • If the record doesn’t exist, create it

    Then you handle concurrency by letting the transaction throw an exception. In your exception handler you can re-query and use the existing value.

    If your transaction dies again (if the record gets deleted), just give an appropriate error message to the user, and tell them to try again.

    You can’t really do this any other way, since you can’t query and commit atomically besides just wrapping it in a transaction, even in a stored procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is the situation: I have a webform that needs to read specific fields
Here's a problem I ran into recently. I have attributes strings of the form
Here is the scenario: I'm writing an app that will watch for any changes
Here we go again, the old argument still arises... Would we better have a
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is what I want to do. Use this HTML line and have the
Here is what I am trying to achieve in PHP: I have this string:
Here's what I'm trying to do... It's quite simple and obviously there must be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.