cfmemcached v1.2 released today - download yours now
I tested and uploaded a new release for cfmemcached today. This update includes a new java library from each branch. Greg and Dustin updated their code, so i'm passing it along to you for your caching pleasure.
This new release includes a number of upgrades to the coldfusion piece as well.
cfmemcachedNew -
- included the updated java library from dustin that has some performance fixes
- Update coldfusion library to have a configurable timeout. Base timeout can be set as well as a time out per request, in case you want to extend it to wait for a long running cache or a bulk operation that needs to wait on several memcached responses
- more cftries and catches - trying to make the application fail gracefully
cfmemcachedOld -
- included the updated java library from greg that has some performance fixes
- added a lot more cftries and catches to make it fail better, ie fail gracefully so that it doesn't impact your overall application.
as always, cfmemcached is located at cfmemcached.riaforge.org -- Coldfusion memcached
first of all thank for your great work on this. We are using memcached
1.1 here with about 2m cache hits / day and it works great.
While trying out the 1.2 i come across this strange behavior.
When i run the memcachedtest and i leave the value for simpleval at
simpleval43466665532 it will not set this value and the set2.get() does return a NO.
For all following variables (set3, set4 etc.) the setX.get() will also return a NO
even though they are being set.
Now the strangest thing. If i cut 2 numbers at the end to make it
simpleval434666655
it will work just fine.
Can you please have a look into this. The queries and arrays are also setting fine, just this one value.
I used the Hermes Vmware Appliance but that is too old :(
Installed a fresh 1.2.5 memcached and now it works fine.
setDefaultTimeoutUnit();
setDefaultRequestTimeout();
instead of :
variables.defaultTimeoutUnit = setDefaultTimeoutUnit();
variables.defaultRequestTimeout = setDefaultRequestTimeout();
as using the assignment will always set true, true than the actual values for both timeOuts
This:
<cfset variables.memcachedFactory = createObject("component","memcachedFactory").init("127.0.0.1:11211")>
Should be:
<cfset variables.memcachedFactory = createObject("component","MemcachedFactory").init("127.0.0.1:11211")>
any idea how to get rid of it?
Thanks,
Gunnar
java.lang.StackOverflowError
at java.lang.ref.ReferenceQueue.poll(ReferenceQueue.java:82)
at java.io.ObjectStreamClass.processQueue(ObjectStreamClass.java:2234)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:266)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
We've run in to issues where data stored through the java client isn't retrievable from the coldfusion client - the coldfusion client can see the key (keyExists works) but retrieving the key through the get() methods returns nothing.
We're using the same memcached java library under the hood - so could it be that its not casting the data properly? We're also storing the java objects as strings when we put them in.
Any insight would be great!
Glad to hear that you are getting some good use out of the library. According to your description, it sounds like what might be happening is that there could be a deserialize issue that is trapping the error and not returning what you would expect. I've used a lot of try/catches to avoid errors. In general, I figured that it would be better to get back nothing and move on than throw an error... Have you tried the retrieval by removing the try catches?
The other suggestion that I could make is that it would probably be beneficial to go get the updated java library. Dustin, the guy who wrote the underlying java library has put in a lot of work to fix the underlying library and has made it much better. I haven't updated the cfmemcached distribution yet. In tests that I've done, it looks like you can just drop in the new jar and not need to make any changes... should just work.
You can find the newest library here:
http://code.google.com/p/spymemcached/
if any of those don't work, the other thing you'd want to take a look at is to make sure that you are using the same hashing scheme for both the java version and the coldfusion version.
In the cf library I've tried to make it so that simple variables get stores as direct simple variables, so as long as you are setting a straight up java string, coldfusion should be able to use it.
Hope that helps!