Skip to content

Conversation

@saulojg
Copy link

@saulojg saulojg commented May 4, 2017

Commit messages should be clear enough. Please reach me if you need further clarifications.

Both changes were properly tested, but outside the test suite since I can't get it to work right now. Here's the test case:

public void testNonCachedReads(){
    Category cached, otherCached, notCached;

    cached = new Category();
    cached.save();

    // read and retrieve from cache
    cached = new Select().from(Category.class).where("id = ?", cached.getId()).executeSingle();
    otherCached = new Select().from(Category.class).where("id = ?", cached.getId()).executeSingle();

    assertTrue(cached==otherCached);

    notCached = new Select().from(Category.class).where("id = ?", cached.getId())
            .setUseCache(false).executeSingle();

    assertTrue(cached!=notCached);
}

saulojg and others added 9 commits May 4, 2017 17:58
The read cache can be avoided when querying the database, by using the
new method com.activeandroid.query.From#setUseCache.
Additionally we've fixed the read cache implementation, which was used
only by the reflective (legacy) model filler. Now the read cache is
applied regardless of the particular model filler in use. We keep the
read cache enabled by default mainly for backwards compatibility
reasons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant