This content has been marked as final.
Show 6 replies
-
1. Re: caching onetomany relation
laszlo.fogas Sep 10, 2006 12:35 PM (in response to laszlo.fogas)anyone?
-
2. Re: caching onetomany relation
laszlo.fogas Sep 19, 2006 2:29 PM (in response to laszlo.fogas)up
-
3. Re: caching onetomany relation
manik Sep 26, 2006 10:45 AM (in response to laszlo.fogas)Do you see any cache update entries in your log file when you try this with simple entities? What do you see in your logs when you try this with collections?
-
4. Re: caching onetomany relation
laszlo.fogas Sep 26, 2006 1:08 PM (in response to laszlo.fogas)Hi,
I did some crosspost sorry! You can find more info here:
http://forum.hibernate.org/viewtopic.php?t=965159
I checked the logs:
update an simple entity:Time: 18:59:59 Priority: DEBUG Thread: TP-Processor2 NDC: null Logger: org.hibernate.cache.TransactionalCache Location: org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:84) Message: updating: xxx.model.Kedvencek#48
during collection update no cache log appears.
And I found an interesting forum topic here, where Gavin says that i want impossible thing:
http://forum.hibernate.org/viewtopic.php?t=956952
What's your opinion about this?
Do i have to manually evict the collection after each update(in postupdate event or in interceptor?)
lazlo -
5. Re: caching onetomany relation
mrohad Sep 27, 2006 1:27 AM (in response to laszlo.fogas)just wonder what is the java command to manualy evict the collection?
thanks -
6. Re: caching onetomany relation
laszlo.fogas Oct 11, 2006 5:39 PM (in response to laszlo.fogas)sorry for answering late:
as far as I know there's no way to access treecache through the hibernate entitymanager. Maybe with a JNDI lookup you can get the underlaying MBean.
But there's a solution: cast the entitymanager to hibernate session and something like this:
org.jboss.ejb3.entity.HibernateSession hs = (HibernateSession) entityManager;
org.hibernate.Session session = hs.getHibernateSession();
session.flush();
session.getSessionFactory().evict(result.getClass(), result.getUid());
lazlo