-
Notifications
You must be signed in to change notification settings - Fork 913
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
Fix derby directory connection string parser #12479
Conversation
arg("jdbc:oracle:thin:@(description = (connect_timeout=90)(retry_count=20)(retry_delay=3) (transport_connect_timeout=3000) (address_list = (load_balance = on) (failover = on) (address = (protocol = tcp)(host = orcl.host1)(port = 1521)) (address = (protocol = tcp)(host = orcl.host2)(port = 1521)) (address = (protocol = tcp)(host = orcl.host3)(port = 1521)) (address = (protocol = tcp)(host = orcl.host4)(port = 1521)) ) (connect_data = (server = dedicated) (service_name = orclsn)))") | ||
.setShortUrl("oracle:thin://orcl.host1:1521") | ||
.setSystem("oracle") | ||
.setSubtype("thin") | ||
.setHost("orcl.host1") | ||
.setPort(1521) | ||
.setName("orclsn") | ||
.build(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an attempt to reproduce the example provided in the issue, but as far as I can tell it seems to work as expected
arg("jdbc:derby:directory:/usr/ibm/pep/was9/ibm/websphere/appserver/profiles/my_profile/databases/ejbtimers/myhostname/ejbtimerdb") | ||
.setShortUrl("derby:directory:") | ||
.setSystem("derby") | ||
.setSubtype("directory") | ||
.setUser("APP") | ||
.setName("ejbtimerdb") | ||
.build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the new test case using the example from the issue
Related to #12400
Updates the derby connection parser to use the value after the last
/
to account for directory structures when pulling the database name out of a connection string like:/usr/ibm/pep/was9/ibm/websphere/appserver/profiles/<REDACTED>/databases/ejbtimers/<HOST_REDACTED>/ejbtimerdb
Unrelated to this change, I also refactored the tests a bit to have separate test methods and argument classes for each database type because I found having all databases in the same test made it annoying when debugging. If we would prefer to keep it the way it was I can swap it back.
The issue also reported a problem with Oracle parsing, but when using the connection string provided in a test, things seem to work as expected.