I've a mapped collection that is not updated when I add items to that collection externally, in another application.
Second-level caching is disabled.
Example...
Code:
session = HibernateDataSource.openSession();
User dao = (User) session.load(User.class, 2434152);
// No items now, this gives 0
System.err.println(dao.getItems().size());
session.close();
Thread.sleep(10000);
// Add an item outside, e.g. in PMA
session = HibernateDataSource.openSession();
HibernateDataSource.getSessionFactory().evict(User.class);
HibernateDataSource.getSessionFactory().evict(UserItem.class);
HibernateDataSource.getSessionFactory().evictCollection(User.class.getName() + ".items");
dao = (User) session.load(User.class, 2434152);
// Still zero
System.err.println(dao.getItems().size());
session.close();
I've tried several solutions when googling, e.g. setting the collection as dirty. None worked.
Is there something else that I haven't looked at?