Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7788909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:07:40+00:00 2026-06-01T21:07:40+00:00

I am using JPA with Hibernate 3 and Spring 3.5. I am unable to

  • 0

I am using JPA with Hibernate 3 and Spring 3.5.
I am unable to make JPA/hibernate refresh to changes made in database in the backend outside of hibernate (via direct queries).
I am using EHCache , and second level caching. Following are the key configuration items:

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <!-- key properties pulled from prop file -->        
    <property name="driverClass" value="${dataSource.driverClassName}"/>
    <property name="jdbcUrl" value="${dataSource.url}"/>
    <property name="user" value="${dataSource.username}"/>
    <property name="password" value="${dataSource.password}"/>
    <property name="maxPoolSize" value="50"/>
    <property name="maxIdleTime" value="14400"/>
    <property name="checkoutTimeout" value="5000"/>
    <property name="idleConnectionTestPeriod" value="60"/>
    <property name="preferredTestQuery" value="select 1"/>
    <property name="maxAdministrativeTaskTime" value="300"/>
    <property name="numHelperThreads" value="10"/>
</bean>

<!-- We are Using JPA -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="persistenceXmlLocation" value="classpath:persistence.xml"/>
    <property name="jpaProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">true</prop>
            <prop key="hibernate.use_sql_comments">false</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            <prop key="hibernate.generate_statistics">true</prop>
            <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
            <prop key="hibernate.cache.use_second_level_cache">true</prop>
            <prop key="hibernate.cache.use_structured_entries">true</prop>
            <prop key="hibernate.cache.generate_statistics">true</prop>
        </props>
    </property>
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
    </property>
</bean>

I am also using JpaTransactionManager with Propagation=REQUIRED for all methods interacting with entities.

Please advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:07:41+00:00Added an answer on June 1, 2026 at 9:07 pm

    Changing the database through the “back door” is in contradiction to using a orm especially with a cache.

    I would try to avoid this situation completely (although I know that you have needs for it).

    A solution using the back door cold be:

    1. Send a notification to the application using hibernate.
    2. This Notification leads to an eviction of the cache (Probably the notification can contain infromation about the part of the cache to be evicted).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using JPA with Hibernate to connect to a Postgres database, and I'm unable
Let's imagine a Spring 3.1 web mvc application using MySql via Hibernate JPA via
I am using Hibernate JPA and Spring with a Mysql database and I want
I am using Spring 3, JPA + Hibernate for a CMS application. In that
I'm using Spring with Hibernate as a JPA provider and are trying to get
I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate
I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate
I am building a category-based web application multilanguage using JPA/Hibernate + Spring I currently
I'm building a webapp using JQuery, Stripes, Spring and JPA (Hibernate). I have a
I'm using Hibernate JPA and Spring in my project. Suppose if I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.