we are having a clustered enterprise application using JTA transaction and hibernate for database operations deployed on JBoss EAP.
To increase system performance we are planning to use Jboss data grid. This is how I plan to use jboss data grid:
- I am adding/replacing the object is cache whenever its inserted/updated in database using cache.put
- when object is deleted from database its deleted from cache using cache.remove
- while retrieving, first try to get the data from cache using key or query. If data is not present, load the data from database.
However, I have below questions on data grid:
- To query objects we are using hibernate criteria however data grid uses its own query builder. Can we avoid writing separate query for hibernate and datagrid?
- I want a list of objects to be returned matching a criteria. If one of the objects matching the criteria is evicted from cache, is it reloaded automatically from database?
- If the transactions is rolled back is it rolled back from data grid cache as well
- Are there any examples which I can refer for my implementation of data grid?
- which is better choice for my requirement infinispan as 2nd level cache or data grid in library or remote mode?