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
Dbinteraction #228
Dbinteraction #228
Conversation
… changed some logice to remove unnecessary db call
try { | ||
return queryDAO.query(qp); | ||
} catch (Exception e) { | ||
throw new ResponseException(ErrorType.TenantNotFound); |
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.
[minor]Use generic error message "e.getMessage()" instead of "ErrorType.TenantNotFound)"
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.
Done
try { | ||
String tenantId = qp.getTenant(); | ||
template = getJDBCTemplate(tenantId); | ||
} catch (Exception e) { |
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.
[minor]Handle "ResponseException" instead of "Exception".
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.
Done
synchronized (readerJdbcTemplate) { | ||
readerJdbcTemplate = new JdbcTemplate(masterDataSource); | ||
} | ||
|
||
// String databasename="ngbcsource2"; | ||
// SELECT EXISTS(SELECT datname FROM pg_database WHERE datname = 'tenant2'); | ||
String sql = "SELECT database_name FROM tenant WHERE tenant_id = ?"; |
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.
[major]only suggestion, No need to write the select query operation here so we can compare "tenantidValue"with append string with prefix database name "ngb" like as ngb+tenantidValue..
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.
Done
This changes the db handling and adresses a few bugs introduced by tenant handling