-->
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: Spring/hibernate/JPA Data Caching issue
PostPosted: Wed Dec 05, 2012 3:44 pm 
Newbie

Joined: Wed Dec 05, 2012 3:34 pm
Posts: 1
I am trying to update some data on APP and sending the JMS Event to the different JBOSS server.
The listener will get the event and try to read the data using a view with dblink.

My issue is that while reading with JPA/HIBERNATE it is still reading the old data which is comming as blank.


this is my configuration
<bean id="tfnEntityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="dataSource" ref="tfnDataSource" />
<property name="packagesToScan">
<list>
<value>core.model.entity</value>
<value>core.model.lookup</value>

</list>
</property>
<property name="jpaPropertyMap">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9iDialect</prop>
<prop key="hibernate.jdbc.batch_size">10</prop>
</props>
</property>
</bean>

The service layer to call the dao layer is using the following transcation
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)

The DAO Layer is using
@PersistenceContext
private EntityManager em;

Query query = em.createNativeQuery(sbQuery.toString());


I tried with all the following option and it doesnt seems to be work.

em.clear();
em.getEntityManagerFactory().getCache().evictAll();
em.flush();
query.setHint("javax.persistence.cache.storeMode", CacheStoreMode.BYPASS);

The only way it works is if I need to do a straight JDBC Call to view first and then call the service layer it seems to be working.

Any thought why its not working on the normal behaviour and y do i need to do a staright jdbc to the call ?????

Any help is really appreciated.


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.