testcontainers / testcontainers/testcontainers-java

Mssql java hibernate locks tables

Open
#3,414 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

resolution/waiting-for-info
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

The Issue is:
-When running the application (spring data mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04) with a docker container everything worked as expected.
-When running the application with testcontainers the tables stayed locked (using the same image all the time).
-When removing the crudRepository from Spring Data in the test and using the raw entity manager the tables locked (the test could pass because of the persistence context of hibernate).
-When using raw JDBC the test worked fine.

I'm using Junit 5, testcontainerVersion 1.14.3 and Hiberante core 5.4.21.Final (spring boot version2.3.4.RELEASE).

I don't really know if this is an Hiberante or a testcontainers issue, because Hibernate did work normally with docker, but started locking tables with when testcontainers got involved.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files or specific test entry points are named. Start by reproducing the JUnit 5 test with Testcontainers 1.14.3, Hibernate 5.4.21.Final, Spring Boot 2.3.4, and the stated SQL Server image, then compare CrudRepository, raw EntityManager, and JDBC behavior; done means identifying whether Testcontainers or Hibernate causes the table locks and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, spring
Domain
backend, databases, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.