0
How control multiple users to access same page?

/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/td-p/307246
Aug 03, 2007
Aug 03, 2007
Copy link to clipboard
Copied
Hi,
I am working on a public page where the data pull from database base on different UUID. Where this page doesn't required login account. It differential by UUID where it send via email.
What I affaird in the email that contain UUID that might forward to multiple users for filling in a long forms with same UUID.
(This form it could be share same department but different sections).
How can I lock this page or only allow accessing by a user until been submitted?
I am working on a public page where the data pull from database base on different UUID. Where this page doesn't required login account. It differential by UUID where it send via email.
What I affaird in the email that contain UUID that might forward to multiple users for filling in a long forms with same UUID.
(This form it could be share same department but different sections).
How can I lock this page or only allow accessing by a user until been submitted?
TOPICS
Advanced techniques
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307247#M27647
Aug 04, 2007
Aug 04, 2007
Copy link to clipboard
Copied
please clarify your problem - your description is not very
clear....
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307248#M27648
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
Basically this page is link via url UUID which send by email-
which is unique base on Dept ID and it is sending to all dept
head's to fill in.
What I affaird the he/she might forwards this to couple staffs with same Dept ID to fill in - which might be error if someone saved it last will be over write the early saved.
So i would like to control this page that it only allow 1 user to view the page at a time sometime like lock but i cannot implement with login account as I would like it to be simple and easy.
Please advise.
What I affaird the he/she might forwards this to couple staffs with same Dept ID to fill in - which might be error if someone saved it last will be over write the early saved.
So i would like to control this page that it only allow 1 user to view the page at a time sometime like lock but i cannot implement with login account as I would like it to be simple and easy.
Please advise.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307249#M27649
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
Locks check concurrent actions, two users acting at the same
time. What you want is to make it impossible for one user to
overwrite the previous efforts of a colleague. So a lock would
solve only part of the problem.
I would record every form submission by ID in the database. When a user opens the form page I would run an initial check to see if a form corresponding to his or her UUID had previously been submitted. I am assuming that you already have a way to validate the UUID beforehand.
Now, consider the case where two users having the same UUID are concurrently filling the form. It suggests that you should also include code that does a check when the user presses the submit button. It should verify from the database whether a form corresponding to that UUID had already been submitted.
What about the time wasted by the later user? You will have to ignore such matters, as you want things "to be simple and easy".
I would record every form submission by ID in the database. When a user opens the form page I would run an initial check to see if a form corresponding to his or her UUID had previously been submitted. I am assuming that you already have a way to validate the UUID beforehand.
Now, consider the case where two users having the same UUID are concurrently filling the form. It suggests that you should also include code that does a check when the user presses the submit button. It should verify from the database whether a form corresponding to that UUID had already been submitted.
What about the time wasted by the later user? You will have to ignore such matters, as you want things "to be simple and easy".
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307250#M27650
Aug 08, 2007
Aug 08, 2007
Copy link to clipboard
Copied
Thank BKBK.
Yes, I hv a code that verify if submitted if will lock n show a message.
The prob i hv is concurrent filling the form. How can I able to lock this that only allow 1 visitor at a time?
Any syntax that can do this? CFLOCK able to do the trick?
Yes, I hv a code that verify if submitted if will lock n show a message.
The prob i hv is concurrent filling the form. How can I able to lock this that only allow 1 visitor at a time?
Any syntax that can do this? CFLOCK able to do the trick?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307251#M27651
Aug 08, 2007
Aug 08, 2007
Copy link to clipboard
Copied
you could do something like this to prevent concurrent access
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307252#M27652
Aug 09, 2007
Aug 09, 2007
Copy link to clipboard
Copied
do you have a last modified date on the table being updated?
if so, when you pull up the record store the date in a field and check to make sure it's the same when the user runs the update.
you can keep track of the first person who enters the site, create a session for that person, and set a timeout so that if they haven't submitted the changes within an hour or so, that it unlocks.
if so, when you pull up the record store the date in a field and check to make sure it's the same when the user runs the update.
you can keep track of the first person who enters the site, create a session for that person, and set a timeout so that if they haven't submitted the changes within an hour or so, that it unlocks.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307253#M27653
Aug 09, 2007
Aug 09, 2007
Copy link to clipboard
Copied
Hi BKBK.
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
ps: dept_id = base on URL.UUID.
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
ps: dept_id = base on URL.UUID.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307255#M27655
Aug 09, 2007
Aug 09, 2007
Copy link to clipboard
Copied
Qoop wrote:
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
ps: dept_id = base on URL.UUID.
That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
ps: dept_id = base on URL.UUID.
That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307254#M27654
Aug 09, 2007
Aug 09, 2007
Copy link to clipboard
Copied
Hi Nytyme,
I also thought same as u but i would like to try on BKBK's method if doesnt work.. i will using database to control.
eg:
when user view the page > it write into database with timespan
if user refresh/click it update wth new timespan.
If current time > timespan with diff IP address then unlock else lock
something like this
I also thought same as u but i would like to try on BKBK's method if doesnt work.. i will using database to control.
eg:
when user view the page > it write into database with timespan
if user refresh/click it update wth new timespan.
If current time > timespan with diff IP address then unlock else lock
something like this
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307256#M27656
Aug 15, 2007
Aug 15, 2007
Copy link to clipboard
Copied
sorry for late reply.
anyway, here is the code (simplify version), so how do i able to lock base on my code? thanks again.
<cfquery of DEPT info base on the #URL.UUID#>
<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>
anyway, here is the code (simplify version), so how do i able to lock base on my code? thanks again.
<cfquery of DEPT info base on the #URL.UUID#>
<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307257#M27657
Aug 16, 2007
Aug 16, 2007
Copy link to clipboard
Copied
Try the above options with your "USE J2EE session varaibles"
enabled in the Memory variables of CFMX administrator. It would
solve the concurrent issues in terms of sharing the session
variables. Try & reply me back.
Could u please share the version of your CFMX server ?
Could u please share the version of your CFMX server ?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307258#M27658
Aug 16, 2007
Aug 16, 2007
Copy link to clipboard
Copied
Hi Prabhu,
I am using CFMX 6 but the server is sharing with other applications.
I am using CFMX 6 but the server is sharing with other applications.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307259#M27659
Aug 16, 2007
Aug 16, 2007
Copy link to clipboard
Copied
Is there any progress in using the "Use J2EE session
variables" ?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307260#M27660
Aug 19, 2007
Aug 19, 2007
Copy link to clipboard
Copied
Qoop wrote:
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
BKBK wrote:
That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.
Qoop later wrote:
anyway, here is the code (simplify version)...:
<cfquery of DEPT info base on the #URL.UUID#>
<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>
I have tested my suggestion. It works.
I can see where your code is leading to. However, it does not follow the line I suggested on 08/08/2007. Its logic is essentially different from mine. In my code, the condition for displaying the form is in a lock. In your code, the form is displayed unconditionally.
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
BKBK wrote:
That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.
Qoop later wrote:
anyway, here is the code (simplify version)...:
<cfquery of DEPT info base on the #URL.UUID#>
<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>
I have tested my suggestion. It works.
I can see where your code is leading to. However, it does not follow the line I suggested on 08/08/2007. Its logic is essentially different from mine. In my code, the condition for displaying the form is in a lock. In your code, the form is displayed unconditionally.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307261#M27661
Aug 20, 2007
Aug 20, 2007
Copy link to clipboard
Copied
Hi BKBK,
I understand ur code, which u lock when database recordcount found.
But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.
Hope this is clear.
ps:
<cflock name="#variables.dept_id#" throwontimeout="Yes" type="readonly" timeout="3">
option 1) I tried to write the dept A in temp database in here if someone is retrieve dept A but then if the person close the browser before submit which the temp database unable to release then it will always lock. Unless i hv to write another code to check every 30 mins to clear the temp database, this help able to release it.
option 2) need to do something here to lock... (still thinking some way)
</cflock>
thanks BKBK.
I understand ur code, which u lock when database recordcount found.
But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.
Hope this is clear.
ps:
<cflock name="#variables.dept_id#" throwontimeout="Yes" type="readonly" timeout="3">
option 1) I tried to write the dept A in temp database in here if someone is retrieve dept A but then if the person close the browser before submit which the temp database unable to release then it will always lock. Unless i hv to write another code to check every 30 mins to clear the temp database, this help able to release it.
option 2) need to do something here to lock... (still thinking some way)
</cflock>
thanks BKBK.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307262#M27662
Aug 20, 2007
Aug 20, 2007
Copy link to clipboard
Copied
Qoop wrote:
But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.
You may leave out the database code if you want. Try something like:
But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.
You may leave out the database code if you want. Try something like:
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/how-control-multiple-users-to-access-same-page/m-p/307263#M27663
Aug 29, 2007
Aug 29, 2007
Copy link to clipboard
Copied
Hi all,
Sorry for such late reply.
I hv solved the prob.. by combine BKBK and Nytyme methods.
So far, its work prefectly :)
Thanks again guys for all ur great help and advised.
Sorry for such late reply.
I hv solved the prob.. by combine BKBK and Nytyme methods.
So far, its work prefectly :)
Thanks again guys for all ur great help and advised.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

