RE: [coldbox:16300] Cachebox and null values

Yep, that sounds correct. See if you can get a stripped down sample of the bug in action so we can play with it.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

I tried creating a GIST with all of the necessary files but GIST seems to be taking a nap / out to lunch and wouldn’t allow me to save.

Here is a simple handler that shows the issue:

//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;

}
}

You will also need to add this to your CacheBox settings.

// JDBC Cache

database = {

provider = “coldbox.system.cache.providers.CacheBoxColdBoxProvider”,

properties = {

objectDefaultTimeout = 120,

objectDefaultLastAccessTimeout = 30,

useLastAccessTimeouts = true,

reapFrequency = 5,

evictionPolicy = “LRU”,

evictCount = 5,

maxObjects = 1000,

objectStore = “JDBCStore”,

dsn =“guardly”,

table = “cachebox”,

tableautocreate = “false”

}

}

Thanks.

Nolan