Created
October 18, 2012 20:29
-
-
Save nolandubeau/3914533 to your computer and use it in GitHub Desktop.
CacheBoxProvider / JDBC Store and Null values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Test.cfc handler | |
//Running on Coldbox 3.5.1, Adobe CF 9.0.2 | |
component output="false"{ | |
property name="cache" inject="cachebox:database"; | |
// HTTP Security | |
this.allowedMethods = {}; | |
function index(event){ | |
var rc = event.getCollection(); | |
local.cacheKey = "user-tom-foolery"; | |
local.user = {}; | |
local.user.name = "Tom Foolery"; | |
local.user.email = "funny@businesscorp.com"; | |
local.user.age = javaCast("null",0); | |
//dump out the user, struct will contain the null key | |
writedump(local.user); | |
//set the user into cache | |
cache.set(local.cacheKey,local.user, 10, 20); | |
//dump out the cached user, struct will not contain the null key | |
if(cache.lookup( local.cacheKey ) ){ | |
writedump(cache.get( local.cacheKey )); | |
} | |
abort; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment