Skip to content

Commit

Permalink
TEIIDDES-1959: Avoid updating the jdbc user/password erroneously
Browse files Browse the repository at this point in the history
* The jdbc user/password are, by default, hard-coded and never queried from
  the server hence the ServerListener should not try and update them since
  this overwrites a potentially correct username with a default incorrect
  username
  • Loading branch information
Paul Richardson committed Dec 3, 2013
1 parent 9aa48b6 commit 4d46edf
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ public void serverChanged(IServer server) {

ITeiidServer newTeiidServer = factory.adaptServer(server, ServerOptions.NO_CHECK_SERVER_REGISTRY, ServerOptions.NO_CHECK_CONNECTION);

// Cannot use updateServer as it replaces rather than modified the existing server
// and references in editor will thus hang on to the old defunct version
teiidServer.update(newTeiidServer);
/*
* Cannot use updateServer as it replaces rather than modifies the existing server
* and references in editor will thus hang on to the old defunct version.
*
* Only update the settings which may have been queried from the server.
*/
teiidServer.getTeiidAdminInfo().setAll(newTeiidServer.getTeiidAdminInfo());
teiidServer.getTeiidJdbcInfo().setPort(newTeiidServer.getTeiidJdbcInfo().getPort());

teiidServer.notifyRefresh();

return;
Expand Down Expand Up @@ -140,8 +146,14 @@ public void serverChanged(ServerEvent event) {
ITeiidServer queryServer = factory.adaptServer(parentServer,
ServerOptions.NO_CHECK_SERVER_REGISTRY);

if (queryServer != null)
teiidServer.update(queryServer);
if (queryServer != null) {
/*
* Updates those settings that may have been successfully queried from the
* contacted server.
*/
teiidServer.getTeiidAdminInfo().setAll(queryServer.getTeiidAdminInfo());
teiidServer.getTeiidJdbcInfo().setPort(queryServer.getTeiidJdbcInfo().getPort());
}
else {
// If the query server is null then this is not a Teiid-enabled JBoss Server but
// a TeiidServer was cached in the registry, presumably due to an adaption
Expand Down

0 comments on commit 4d46edf

Please sign in to comment.