By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Will simultaneous access defeat this strategy?

P: n/a
I want to have a master table and a detail table. I want the master table
record to be created only if one does not exist already for a given account
ID.

Here is my concern:

Let's say I have several different web pages being viewed by several
different web surfers. The viewing of the web pages triggers the same PHP
code that attempts to locate a desired master record, auto-creating it if it
does not exists.

Could I end up with several copies of master records with the same account
ID, since the multiple running instances of the PHP code did not find the
master record when they went to look for it? This would break the strategy
since the strategy is dependent on there being one and only master record
for a particular ID.

If so, what is the proper coding strategy for enforcing this strategy?
Locking, semaphores, etc? Any samples you can point me to would be more
than welcome.

thx

--

Robert Oschler
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.