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.
|