Have you tried to activate EHCache for hibernate ?
I think it may help you even if it is sub-optimised with a very general configuration...
Thanks for the reply. I have tried, but it does not seem to have much effect.
Looks like many of the API-methods are implemented using hql-queries or criteria searches, and none of them have enabled caching. I have enabled class and collection caching, but it does not have much effect when most of the logic runs like queries that are not being cached..
As an example this "regular" way of getting a user is not cached:
org.jbpm.api.identity.User user = identityService.findUserById(userName);
In order to get caching working here we need to reimplement the criteria search used:
org.jbpm.api.identity.User user = (org.jbpm.api.identity.User) session .createCriteria(UserImpl.class) .add(Restrictions.eq("id", userName)) .setCacheable(true) .uniqueResult();
Not a big deal for such a simple method, but more of a concern seeing that it is the same for all queries in the system.
It's a very good idea, I think you could open a JIRA request for that