Skip to main content
Participant
May 11, 2006
Question

CFMX7 not using database for client variables

  • May 11, 2006
  • 3 replies
  • 843 views
I have been unable to get MX7 (7,0,1,116466 with chf7010002 update) running on win2003 to use my SQL2000 or SQL2005 database to store client variables. This has happened on multiple installs for different servers.

Here is what I have done thus far:

- created the database to store the variables in SQL
- created the datasource (client_variable_storage) for the database in cf admin
- added the datasource (client_variable_storage) as a storage option in the client variables section of cfadmin
- - - selected create client database tables (created successfully)
- - - selected Disable global client variable updates option
- selected client_variable_storage as the default storage mechinism in the client variables section of cfadmin
- restarted cf

When I ran my app, nothing enters into the CDATA or CGLOBAL fields in the database. Here is the cfapplication tag I am using:

<cfapplication clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#CreateTimeSpan(0,2,0,0)#" name="mycf_System">

After this did not work I wrote a cfm page using this datasource to create a table, insert data, and read the data to test permissions. This worked fine.

I then created a new cfm page with the same cfapplication tag on it except adding the clientstorage attribute:

<cfapplication clientmanagement="Yes" sessionmanagement="Yes" setclientcookies="Yes" sessiontimeout="#CreateTimeSpan(0,2,0,0)#" name="mycf_System" clientstorage="client_variable_storage">

This also did not use the database to store client variables.

Also, each time I ran a test, I cleared out my cookies so I would get the proper initiation for the test.

Any thoughts on what to do? I'm at a loss.

Thanks!
    This topic has been closed for replies.

    3 replies

    Known Participant
    May 11, 2006
    should have clarified: permissions on CDATA & CGLOBAL. You might be able to use the dsn to access/update other tables, but if perm's aren't correct on where the client data is stored you will run into trouble.

    Also may want to check cookie permissions in the browser - client vars rely on cfid & cftoken from user cookies .
    techie123Author
    Participant
    June 26, 2006
    I checked the permissions and everything looks good. I also wrote insert queries to both tables and coldfusion was able to write and read from both CDATA & CGLOBAL. I also ran a basic example of:

    <cfapplication name="mycf_System" clientmanagement="Yes" sessionmanagement="Yes" clientstorage="client_variable_storage">

    <cflock type="EXCLUSIVE" timeout="5" scope="SESSION">
    <cfset session.greeting = "howdy">
    </cflock>

    <cfoutput>#session.greeting#</cfoutput>

    This created the cookie and using the cfid (70157145) attempted to use the db tables, but no data was written to either. This is what I gathered from SQL Query Analzer:

    RPC:Starting exec sp_execute 1, '705:70157145 ', 'mycf_System '
    SP:ExecContextHit
    SP:StmtStarting select cfid,app,data from CDATA where cfid = @P1 and app = @P2
    SP:StmtCompleted select cfid,app,data from CDATA where cfid = @P1 and app = @P2
    Exec Prepared SQL
    RPC:Completed exec sp_execute 1, '705:70157145 ', 'mycf_System '
    RPC:Starting exec sp_execute 2, '705:70157145 '
    SP:ExecContextHit
    SP:StmtStarting select data from CGLOBAL where cfid = @P1
    SP:StmtCompleted select data from CGLOBAL where cfid = @P1
    Exec Prepared SQL
    RPC:Completed exec sp_execute 2, '705:70157145 '
    SQL:BatchStarting IF @@TRANCOUNT > 0 COMMIT TRAN
    SQL:StmtStarting IF @@TRANCOUNT > 0
    SQL:StmtCompleted IF @@TRANCOUNT > 0
    SQL:StmtStarting COMMIT TRAN
    SQL:StmtCompleted COMMIT TRAN
    SQL:StmtStarting
    SQL:StmtCompleted
    SQL:BatchCompleted IF @@TRANCOUNT > 0 COMMIT TRAN
    SQL:BatchStarting SET TRANSACTION ISOLATION LEVEL READ COMMITTED
    SQL:StmtStarting SET TRANSACTION ISOLATION LEVEL READ COMMITTED
    SQL:StmtCompleted SET TRANSACTION ISOLATION LEVEL READ COMMITTED
    SQL:BatchCompleted SET TRANSACTION ISOLATION LEVEL READ COMMITTED
    TraceStop

    Any ideas?

    Thanks!




    Participating Frequently
    May 11, 2006
    Ok, first things first: have you tried the bare mimimum scenario?

    <cfapplication name="mycf_System" clientmanagement="Yes" clientstorage="client_variable_storage" sessionmanagement="Yes">

    Are you locking all the session variables that you want to read? Are you doing any translation of those variables into non-session names (.e.g <cfset myvar = session.myvar)

    If you can post some more of the code, especially where you are collecting the vars to insert, that would help.

    &laz;

    Known Participant
    May 11, 2006
    Have you checked permissions on both the datasource in cfadmin, and the sql logins?
    techie123Author
    Participant
    May 11, 2006
    Everything looks good, and as I indicated in the previous post the cf server was able to create a test table, insert data, and read the data from this datasource.