I set up a custom snippet in my Application.cfm and OnRequestEnd.cfm that allows storing of complex data in a database using WDDX.  We're not using client variables, but rather a custom version that is of a similar mechanism, but the same idea will work either way.  Basic process is something like this:
 
 - CFAPPLICATION tag
 - deserialize client.wddx with CFWDDX into client.data
 - do the rest of the request, always refering to client.data, rather than just client.  so you'd have client.data.myQuery rather than the more 'typical' client.myQuery
 - in onRequestEnd, serialize client.data with CFWDDX into client.wddx
 - structDelete(client, "data", false)
 
After the rquest, CF will happily serialize a single client variable (named 'wddx') that contains a string. and then return it for the next request.
 
Since we're using a custom setup, we actually just overwrite the scope (we call our 'clientvars') so we don't have the intermediary 'data' in our names, but I"m not sure you can do that with the client scope.
 
The WDDX definitely has a performance cost, but it's been even smaller than I could have hoped for when we first went to that mechanism.  The flexibility you'll gain is worth the price.
 
cheers,
barneyb


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ramene Anthony
Sent: Thursday, February 12, 2004 3:31 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Converting Session Scope (complex data type) to Client Scope (simple data type)
Importance: High

Team

 

How does one go about converting *from*, wisely, session scope to client scope.  While being mindful of the fact that speed does play a big role in the application.  As of current,  the application is storing quite a few items in memory, complete queries (ie, <cfquery name=”session.name” …> )  - Im sure the question has been raised before

 

My issue is no different as I simply need to, store the same data in Client scope (database) while not sacrificing speed.

 

My peers have advised me to get away from doing this… but that’s not my call nor can I even claim responsibility for going this route to begin with as much as I might agree with all your helpful replies.

 

Best Regards

R. Anthony

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

Reply via email to