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

  • Home
  • SEARCH
  • 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 7858903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:39:53+00:00 2026-06-02T21:39:53+00:00

I have an JPA/Hibernate/Spring/Tomcat web application with second level data cache enabled for performance

  • 0

I have an JPA/Hibernate/Spring/Tomcat web application with second level data cache enabled for performance reasons. And the cache does its work very well!

I also have a Cucumber test suite which adds some test data directly to the application’s database and then performs some Selenium steps. Of course it fails as the application doesn’t see the updates because of the 2nd level cache.

I know I can make special build for testing with cache disabled (by passing some boolean property for Maven filtering or similar) But there are a lot of @Cache annotated entities so disabling the cache makes the application fail with exception “Second level cache is not enabled”.

Another approach could be to use ehcache remoting to clear the cache or configure it with zero object lifetime or similar.

I can also create my test data using application UI only but this adds unnecessary complexity to the test cases so I prefer to write them to the DB before test run.

Could anybody share their approach to integration-test applications with 2nd level data cache enabled?

  • 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-02T21:39:55+00:00Added an answer on June 2, 2026 at 9:39 pm

    Since you’re talking about functional tests via Selenium, you should consider your app as a black box and test it as Selenium was actually a User. So you need to pass data via web interface and then test how the app processes it and shows it afterwards.

    Alternative to such application-wide functional tests will be a Behavior Driven Development with tests for different components. Component here is some flow starting from your controller ending with DAO (usually DAO is mocked in such tests which make them pass very fast, but doesn’t test working with database). In this case you have a small set of full environment tests and a large set of BDD tests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application written in Java (Spring, Hibernate/JPA, Struts2) where users can
I have a web application that uses spring and hibernate for JPA support, but
I have an application using Tomcat/Spring 3/JPA/Hibernate but my merges do not commit to
I have a Spring/JPA/Hibernate application and am trying to get it to pass my
I have a Spring/JPA application with Hibernate as the JPA provider. I've configured a
I have a JPA/Spring application that uses Hibernate as the JPA provider. In one
I have an application that uses Hibernate/JPA, with Spring and Jersey. In my application
I have a Spring application which uses JPA ( Hibernate ) initially created with
I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate
My colleague and I have a web application that uses Spring 3.0.0 and JPA

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.