[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: second level cache

loic do-not-reply at jboss.com
Thu Dec 6 15:41:42 EST 2007


Thanks a lot, i get it worked well.

But i have another matter with cache.

I use my findAll function well, and know i would like to get a subpart of the list putted in cache.

So i created a new function


  | public void findTest() {
  | 		// TODO Auto-generated method stub
  | 			  			  		em.createQuery("SELECT c FROM FileToSend c where name =?1").setParameter(1,"test").getResultList();
  | 		}
  | 	}


When i use it, even if the resulted entities are already in cache, it connects to the database to get results...
 (For the second time call it doesn't... but i need it to get data from cache for the first call).


Any idea on how to do it??

I did test with HibernateSession createFilter function on my first loaded collection but i get an error :

20:04:59,109 ERROR [STDERR] javax.ejb.EJBException: org.hibernate.QueryException
  | : The collection was unreferenced

Thanks a lot for helping.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110993#4110993

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110993



More information about the jboss-user mailing list