-
Notifications
You must be signed in to change notification settings - Fork 280
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
Make validateConfiguration public to allow checking of validation query #1327
Make validateConfiguration public to allow checking of validation query #1327
Conversation
Looks good, jody. However, I thought the connection pool would normally validate the connection. Also, if a specific validation query is required, why give the user the option of setting it? Perhaps this should be a UI change? |
Yes, in this case I am wishing to provide form feedback from GeoServer incase they are missing a field. Presently GeoServer DiskQuota screen just saves the file, and it is not until GWC tries to read it that the result is validated. GeoServer does not try connecting before saving the changed file! |
… of validation query This method is used by GWC to check jdbc configuration files when loaded. Making the method public allows it to also be used by the GeoServer form.
b2d8850
to
e05edc0
Compare
cp.setDriver("org.postgresql.Driver"); | ||
cp.setUrl("jdbc:postgresql:gttest"); | ||
|
||
cp.setValidationQuery("select 1 from DUAL"); |
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.
I think dual is only for Oracle.
pgsql# select 1 from dual;
ERROR: relation "dual" does not exist
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.
Yep
The backport label is not success |
@@ -28,4 +29,7 @@ protected Properties createOfflineFixture() { | |||
protected String getFixtureId() { | |||
return "h2"; | |||
} | |||
|
|||
@Test | |||
public void checkConnectionTest() {} |
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.
Don't think an empty test does much good... probably a leftover.
This method is used by GWC to check jdbc configuration files when loaded. Making the method public allows it to also be used by the GeoServer form.