-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Collection not updated when records inserted externally
PostPosted: Wed May 25, 2011 12:47 am 
Newbie

Joined: Mon Sep 27, 2010 2:07 am
Posts: 3
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.