}
public void testCachedQueryOnInsert() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
Simple simple = new Simple();
simple.setName("Simple 1");
s.save( simple, new Long(10) );
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
Query q = s.createQuery("from Simple s");
List list = q.setCacheable(true).list();
assertTrue( list.size()==1 );
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
q = s.createQuery("from Simple s");
list = q.setCacheable(true).list();
assertTrue( list.size()==1 );
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
Simple simple2 = new Simple();
simple2.setCount(133);
s.save( simple2, new Long(12) );
t.commit();
s.close();
s = openSession();