-->
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: Object caching in Hibernate
PostPosted: Wed Aug 19, 2009 3:09 am 
Newbie

Joined: Wed Aug 19, 2009 2:55 am
Posts: 1
Hi folks,

I need to query several Databases for certain entities. I now stumbled upon the problem that Hibernate does have so called "L1" cache, that is enabled by default and that therefore multiple requests against my datasources return the same Objects although the some properties (row values) have changed.

I cannot control changes to the database since those are performed by another application.

My current setup is on top of Tomcat 6 and Spring 2.5:
- 10 ODBC Datasources using the Sun JDBC/ODBC bridge, wrapped by the XAPool of enhydra.org.
- The JOTM Transaction Manager
- Hibernate as JPA Provider with 10 persitence units configured using Spring.

My question is now: What are the options to disable L1 caching overall for these EntityManagers or for certain Entities? Or how can I programmatically ensure that the data provides is allways fetched from the database. I've read already a little about some possible options, (SessionFactory.evict, EntityManager.clear, ..), but I am after all not sure, which works best and can be implemeted with little effort. If anyone has some suggestions I'd be most gratefull.

greets,
Christian


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.