Skip to content

ContainerDatabaseDriver.connect misbehaviour fix - #66

Merged
rnorth merged 3 commits into
testcontainers:masterfrom
krystiannowak:master
Feb 17, 2016
Merged

rnorth merged 3 commits into
testcontainers:masterfrom
krystiannowak:master

Conversation

@krystiannowak

Copy link
Copy Markdown
Contributor

Wrong behaviour of ContainerDatabaseDriver.connect causing DriverManager.getConnection misbehaviour

The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL.
his will be common, as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn.

(from java.sql.Driver connect method's JavaDocs)

Currently the driver throws an IllegalArgumentException:
JDBC URL matches jdbc:tc: prefix but the database or tag name could not be identified

The only exception expected is SQLException: if a database access error occurs or the url is "null"
The driver should throw an SQLException if it is the right driver to connect to the given URL but has trouble connecting to the database.

Potentially the current acceptsURL method's behaviour might be reused for that - and this is used in the PR.

@rnorth

rnorth commented Feb 16, 2016

Copy link
Copy Markdown
Member

Thank you for spotting and fixing this mistake - it's much appreciated. I'll try and get this merged and released this week.

As a contributor, please could you add yourself to the AUTHORS file and authors list in the root POM for credit?
Thank you
Richard

@krystiannowak

Copy link
Copy Markdown
Contributor Author

Very small contribution for that, but thanks - added.

Cheers,
Krystian

@krystiannowak

Copy link
Copy Markdown
Contributor Author

Seems like timeout in CircleCI build.

@krystiannowak

Copy link
Copy Markdown
Contributor Author

@rnorth CicleCI fails again - is there any chance it currently also fails on the main branch (timeout when waiting for mysql:latest image to start and be operational it seems)?

@krystiannowak

Copy link
Copy Markdown
Contributor Author

@rnorth Now all builds are passing - you can safely merge it

@rnorth

rnorth commented Feb 17, 2016

Copy link
Copy Markdown
Member

Hi @krystiannowak
Sorry yes, I've been seeing some occasional timeout issues that have been hard to track down. #51 tracks the most common one. I've not seen a timeout with the mysql container startup yet - will have a look at the logs.
Richard

rnorth added a commit that referenced this pull request Feb 17, 2016
ContainerDatabaseDriver.connect misbehaviour fix
@rnorth
rnorth merged commit fbad7eb into testcontainers:master Feb 17, 2016
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.

2 participants