Hmmmm, I'm not sure what's the effect of querying view tables and spatial fields and I dunno whether the question has really anything to do with JBoss Cache itself. Have you tried to cache the query using standard hash table cache provider and see if that works? If it does, then there might some issue with JBC. If not, then the problem/question is more to do with Hibernate and how it deals with these type of queries.
The same setup is caching other queries so it is this query in particular that is causing an issue.
I don't you understood what I meant. I'm not asking whether other queries get cached or not. You already mentioned that they do. What I'm asking is the following:
Can you use a different cache provider, i.e. HashtableCacheProvider (i.e. see http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#performance-cache ) and see if the query you're having issues with gets cached or not?