Skip to content

Projection isn't found in tx cache #31

@lavrukov

Description

@lavrukov

let's imagine Entity(id, value) with projection ValueIndex(id_value, entity_id). If we save in tx some entity and after it try to find projections - they will be unchanged

For example: this test is green

    @Test
    public void savedIndexIsNotInCache() {
        Book.Id bookId = new Book.Id("1");

        Book.ByAuthor index1 = db.tx(() -> {
            db.table(Book.class).save(new Book(bookId, 1, "title1", List.of("author1")));
            return db.table(Book.ByAuthor.class).find(new Book.ByAuthor.Id("author1", bookId));
        });

        Book.ByAuthor index2 = db.tx(() -> {
            return db.table(Book.ByAuthor.class).find(new Book.ByAuthor.Id("author1", bookId));
        });

        assertNull(index1);
        assertNotNull(index2);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions