question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Container reuse across r2dbc:tc and jdbc:tc URLs

See original GitHub issue

Could you please enable container reusage across r2dbc and jdbc urls?

Use case (in Spring Boot):

spring:
  r2dbc:
    url: r2dbc:tc:postgresql:///test?TC_IMAGE_TAG=12-alpine
  flyway:
    url: jdbc:tc:postgresql:12-alpine:///test

https://github.com/testcontainers/testcontainers-java/issues/4282

https://github.com/spring-projects/spring-boot/issues/28076

https://github.com/flyway/flyway/issues/3282

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
kiviewcommented, Sep 22, 2021

HI @yerzhant,

thanks for raising this issue and brining it to our attention, this is indeed a very interesting feature. However, implementation might be a bit more involved, so I can’t promise when we will have time to work on this.

Contributions by the community exploring possible implementations are welcome.

2reactions
dinilimentocommented, Jun 28, 2022

I think for JDBC this works by appending ?&TC_REUSABLE=true. I’m using the following:

spring:  
  datasource:  
    flyway:  
      url: jdbc:tc:sqlserver:2019-latest://testcontainers/testdb?TC_REUSABLE=true

Would be good to adjust the documentation accordingly if this is indeed intentional 😸

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to reuse a `testcontainers` container with two different ...
1 Answer 1 ... When you use Testcontainers' JDBC support, which you configure by adding tc in the jdbc url, the lifecycle of...
Read more >
Getting Started | Accessing data with R2DBC - Spring
This guide walks you through the process of building an application that uses Spring Data R2DBC to store and retrieve data in a...
Read more >
Reusable Containers (Experimental) - Testcontainers for Java
In order to reuse a container, the configuration of the container must not change. ... Reusable Container with Testcontainers JDBC URL.
Read more >
Reactive Relational Database Connectivity - R2DBC
constants through ConnectionFactories. Additional options identifiers are created through Option.valueOf(…).. Note that Connection URL Parsing cannot ...
Read more >
Testcontainers With Kotlin and Spring Data R2DBC - DZone
Here we make sure to override our R2DBC connection properties in runtime with the ones pointing to our newly created container. Java. @JvmStatic ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found