-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving Oracle-XE support #4382
Conversation
If you're happy with the PR in principal then I will be happy to update the JDBC documentation to include information on using Oracle XE. |
Hi @justinwyer, thanks for raising the PR, I think we wrote yesterday in the YT stream? But you probably misunderstood me, what I meant is, that we already have an open Oracle XE PR, that we would like to merge. Could you maybe review the already open PR at #4298 and check if it missing anything, that your PR considers? |
I think honouring the SID |
Greats, let's proceed like this 👍 |
@justinwyer We have just merged #4298, so feel free to expand on this, if you think something is lacking 🙂 |
Ah there is really no need with this image, it will create a user in the PDB. I will remove the SID connection. |
bdeefc5
to
88dcdd9
Compare
@kiview I've updated the PR as follows: Current challenges:
Changes:
|
8fddeed
to
594ff9a
Compare
@kiview quick thought, should we allow the full image name and tag as part of the JDBC url rather than just the image tag, given the nature of the Oracle image, there would no longer be a need for the testcontainers.properties at all. |
modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java
Outdated
Show resolved
Hide resolved
modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java
Outdated
Show resolved
Hide resolved
modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java
Outdated
Show resolved
Hide resolved
Current challenges: - Username and password cannot be specified using the JDBC url, this is imporant as the schema name in Oracle is the username - The module only connects using service name and not SID - It does not allow connecting using `system` or `sys` users Changes: - Detect SID `:` or service name `/` in the supplied TC jdbc URL and honor this in the underlying JDBC URL. - Parse username and password from the supplied TC JDBC URL and pass to the underlying JDBC URL. - Switched affected regex patterns to use named groups - Add tests for both SID and service name connections - Allow `system` and `sys`, and do not set `APP_USER` / `APP_PASSWORD` environment variables when it is the provided username in the JDBC url
Re @justinwyer
This is something that we have discussed internally in the past but deferred. Since a docker image name can be a full host+port+path style string, fitting this into the JDBC URL could become messy unless we do it right. I'm not saying we'll never do this, just that we've considered it and found it unpleasant enough not to want to rush into doing it. I'd suggest not worrying about it for this PR 😉 |
Hey @justinwyer, I am sorry for letting you and the PR waiting. The SID and serviceName topic is a bit more complex I think and is better tackled in a future seperate PR and after this PR and #4402 are merged. |
I've taken the liberty of preparing a branch with the URL parsing extracted. I've split out the main change that deals with JDBC URL parsing, and added a bit of further tidying and a minor bugfix. I hope this is OK with you @justinwyer - I'm trying to ensure that you retain credit on the commits/PR. |
Thanks guys, I will close this :) |
Thanks a lot for your work and bringing this on track @justinwyer! |
Current challenges:
Changes:
:
or service name/
in the supplied TC JDBC URL and honour this in the underlying JDBC URL.Additional notes:
Currently Oracle only provides docker scripts to build your own version of 18.4.0 which has a very slow start time (~7 minutes on a decent laptop) in order to make this useful for test cycles it is typical to start this container and then run a
docker commit
on it. This reduces start time to around 10 seconds. The tests now make use of such a container, we should probably retag this container and put it somewhere else other than my docker hub account.