Hal asked:
Do you know if it's possible to use ehcache with stored procs in CF?The answer is yes - but it is important to be clear that when you use the built in query caching (both cfquery and cfstoredproc have automatic support for caching) you are not using the new ehcache-based caching in ColdFusion. Sure it still caches - but it isn't using ehcache under the covers like the newer caching features added to ColdFusion 9. Can you use the new caching functions to store stored proc results? Of course! Don't forget that the new caching functions take any data, period. So you could easily do something like so (warning - pseudo-code):
<cfif isNull(cacheGet("mystoredproc"))>
<cfstoredproc procedure="getBeer" result="result">
<cfset cachePut("mystoredproc", result)>
<cfelse>
<cfset result = cacheGet("mystoredproc")>
</cfif>
Archived Comments
What would be the benefit of putting this in ehcache as opposed to the query caching? Or is there none?
ehcache is a -very- powerful caching system and you can tweak it's performance settings (if you don't mind getting into XML). So if you know ehcache and want to make use of it, then this would be a better option. (afaik)
To build on Ray's comment. Most interesting usage scenario I've done is disk persistence. And, if your database is only written through that application make the persistence permanent so that it stays around between CF restarts.