Skip to content

How to work with transactions? Found some strange behavior. #52

Description

@kirill-kravchenko

I'm using spring-boot-starter-data-jdbc and infobip-spring-data-jdbc-querydsl-boot-starter(5.4.2) together.
In my tests with org.springframework.transaction.annotation.Transactional annotation I have the following code:

@Test
@Transactional
void test() {
    repository.save(ReportList.builder().userName("username").build());

    var reports = repository.query(query -> query
            .select(entityProjection())
            .from(QReportList.reportList)
            .fetch());
}

Expected result: variable reports is not empty
Actual result: variable reports is empty

If I remove @Transactional (or use default findAll method from QuerydslJdbcRepository) it starts to return results.
Am I doing something wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions