farzad wrote:
Quote:
I'd prefer to use JPA API and not hibernate extensions.
To the best of my knowledge L2 caching is not a part of JPA. You will anyways have to use proprietary APIs to manipulate it.
Quote:
You are true, this solution is not adapted if you need a transactionnal cache.
I didn't get this one. What's the deal with a transactional cache? Why would you need a transactional cache?
Farzad-
Lets take as an example an application deployed in a cluster, each node's accessing the database with JPA and a level 2 cache.
Some entities have an attribute for applicative locking and this locks may be modified by triggers in the database. Maybe hundreds of locks may be modified by a single request with a complex filter, it is important to use a SQL statement instead of getting a lot of objects and iterating over the collection to modify locks one by one.
I want all caches of all nodes to be updated as soon as I commit in one node. I don't want another node finding in its level 2 cache an entity without lock if a lock has been put in the database. That's what I understand by "transactionnal cache", a cache that is replicated in the transaction scope.
The trigger that modifies locks may write in dedicated table the list of modified nodes, I thought I could use this list to evict all nodes from the cache.