|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
cannot be accessed without an active lock
I have recently moved servers and when I try to login to the members area, this is the error I get:
An error occurred while evaluating the expression: // username and password match - this is a valid user Session.MM_Username = MM_valUsername; if (MM_fldUserAuthorization IS NOT "") { Session.MM_UserAuthorization = MM_rsUser[MM_fldUserAuthorization][1]; } else { Session.MM_UserAuthorization = ""; } if (IsDefined("accessdenied") AND false) { MM_redirectLoginSuccess = Evaluate("accessdenied"); } Error near line 19, column 7. -------------------------------------------------------------------------------- Symbol Session.MM_Username is in a scope that contains data shared across threads and cannot be accessed without an active lock The error occurred while processing an element with a general identifier of (CFSCRIPT), occupying document position (17:5) to (17:14) in the template file /home2/webuser/directtvfiles-com/public_html/members/login.cfm. My question is how do I get this active lock, I have requested to tech help at my hosting company and they suggest it is the code? |
|
#2
|
|||
|
|||
|
Above CFscript add this:
Code:
<cflock scope="SESSION" type="EXCLUSIVE" timeout="10"> <cfscript> session.mm.whatever = name </cfscript> </cflock> You need that when you are setting a session variables, now when your going to read a session variable you need to do this: Code:
<cflock scope="SESSION" type="READONLY" timeout="10"> <cfscript> name = session.mm.whatever </cfscript> </cflock> Hope that helps. |
|
#3
|
|||
|
|||
|
Ok, thanks for your help, now i get another error:
ODBC Error Code = 22005 (Error in assignment) [MERANT][ODBC MySql driver]Invalid character value. Error in column 6. The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (25:1) to (25:101) in the template file /home2/webuser/directtvfiles-com/public_html/members/membersection.cfm. Here is the page: <cfinclude template="../Connections/db.cfm"> <cfscript> // *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers=""; MM_authFailedURL="accessdenied.cfm"; MM_grantAccess=false; MM_Session = IIf(IsDefined("Session.MM_Username"),"Session.MM_Username",DE("")); if (MM_Session IS NOT "") { if (true OR (Session.MM_UserAuthorization IS "") OR (Find(Session.MM_UserAuthorization, MM_authorizedUsers) GT 0)) { MM_grantAccess = true; } } if (NOT MM_grantAccess) { MM_qsChar = "?"; if (Find("?",MM_authFailedURL) GT 0) MM_qsChar = "&"; MM_referrer = CGI.SCRIPT_NAME; if (CGI.QUERY_STRING IS NOT "") MM_referrer = MM_referrer & "?" & CGI.QUERY_STRING; MM_authFailedURL_Trigger = MM_authFailedURL & MM_qsChar & "accessdenied=" & URLEncodedFormat(MM_referrer); } </cfscript> <cfif IsDefined("MM_authFailedURL_Trigger")> <cflocation url="#MM_authFailedURL_Trigger#" addtoken="no"> </cfif> <cfquery name="rsMembers" datasource=#MM_db_DSN# username=#MM_db_USERNAME# password=#MM_db_PASSWORD#> SELECT * FROM Users WHERE username = '#Session.MM_Username#' </cfquery> the last bit is what is giving the error, is it something in the select area? any help is very much appreciated. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > cannot be accessed without an active lock |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|