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 5844275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:16:10+00:00 2026-05-22T12:16:10+00:00

What is the real difference between nonstrict-read-write and read-write ? I can read ehcache

  • 0

What is the real difference between nonstrict-read-write and read-write? I can read ehcache and Hibernate docs, but as far as I can see they only say that “read-write is better if you do updates”. I find it unsatisfactory.

I may have an issue with long-lived cached collection configured like this:

<cache name="trx.domain.Parent.children" maxElementsInMemory="5000"
    eternal="false" overflowToDisk="false" timeToIdleSeconds="1200"
    timeToLiveSeconds="1800">
    <cacheEventListenerFactory
        class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
        properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true" />

<set name="children" lazy="false" inverse="true">
    <cache usage="nonstrict-read-write"/>
    <key column="callout_id" />
    <one-to-many class="Child" />
</set>

What exactly happens when the collection is updated, on the node where the update occurs and others? What is the difference between nonstrict-read-write and read-write here? Is it possible that a node will use its stale 10-minute version from cache?

Note the lengthy timeouts and asynchronous replication.

  • 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-05-22T12:16:11+00:00Added an answer on May 22, 2026 at 12:16 pm

    Read-write: if two transactions tries to modify data, then these transactions are isolated at the “read committed” level (or repeatable read, if database is set to that) – usually that’s enough, typically we don’t need “serializable” isolation level.

    Nonstrict read-write: cache is not locked at all, so if two transactions modify data we never know what we get, we don’t have guarantee that cache state = database state.

    This is safe only if it is very unlikely that data would be modified simultaneously by two transactions. We need to set appropriate cache timeout too.

    For more details and a very good explanation look here: hibernate cache strategy

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

Sidebar

Related Questions

I see no real difference between the following two methods of creating a setter,
What's the real difference between a foreach and for loop if either can get
What is the real difference between one-to-many and many-to-one relationship? It is only reversed,
Apologies if this is a duplicate question, but is there a real difference between
The only difference I see is the fact that you can't use the "using
Can anyone tell me, what's the real difference between group and role? I've been
Is there any real difference between the behavior or output of these 2. They
Quoting from PerlMonks: The difference between my and local , But in real life,
What is the real difference between a C# static constructor and a Java static
When submitting an app to the app store what is the real difference between

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.