Skip to content
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

Get local host name before opening TDSChannel #324

Merged

Conversation

Suraiya-Hameed
Copy link
Contributor

Fixes #177

@codecov-io
Copy link

codecov-io commented Jun 1, 2017

Codecov Report

Merging #324 into RTW_6.2.0 will decrease coverage by 0.01%.
The diff coverage is 75%.

Impacted file tree graph

@@               Coverage Diff               @@
##             RTW_6.2.0     #324      +/-   ##
===============================================
- Coverage        37.17%   37.15%   -0.02%     
+ Complexity        1670     1666       -4     
===============================================
  Files              103      103              
  Lines            23663    23664       +1     
  Branches          3918     3918              
===============================================
- Hits              8796     8793       -3     
  Misses           13278    13278              
- Partials          1589     1593       +4
Flag Coverage Δ Complexity Δ
#JDBC41 36.98% <75%> (-0.06%) 1655 <0> (-9)
#JDBC42 37.03% <75%> (-0.02%) 1660 <0> (ø)
Impacted Files Coverage Δ Complexity Δ
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 43.17% <75%> (+0.02%) 252 <0> (ø) ⬇️
src/main/java/microsoft/sql/DateTimeOffset.java 37.14% <0%> (-2.86%) 8% <0%> (-2%)
...om/microsoft/sqlserver/jdbc/SimpleInputStream.java 47.4% <0%> (-1.49%) 9% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 29.43% <0%> (-0.68%) 56% <0%> (ø)
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 33.45% <0%> (-0.18%) 89% <0%> (-1%)
...om/microsoft/sqlserver/jdbc/ReaderInputStream.java 46.06% <0%> (ø) 17% <0%> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 45.98% <0%> (+0.1%) 0% <0%> (ø) ⬇️
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 48.93% <0%> (+0.14%) 210% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8f677e...903864a. Read the comment docs.

@@ -1991,6 +1993,14 @@ private void connectHelper(ServerPortPlaceHolder serverInfo,
connectionlogger.fine(toString() + " Connecting with server: " + serverInfo.getServerName() + " port: " + serverInfo.getPortNumber()
+ " Timeout slice: " + timeOutsliceInMillis + " Timeout Full: " + timeOutFullInSeconds);
}

// Before opening the TDSChannel, calculate local hostname
// as the InetAddress.getLocalHost() takes more than usual time in certian OS and JVM combination, it avoids connection loss
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think it should be good if we mention that in Sierra getLocalHost takes lot of time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: As you are moving condition we can reduce complexity by 1 by using StringUtils.isEmpty()

@Suraiya-Hameed Suraiya-Hameed merged commit 1da02b5 into microsoft:RTW_6.2.0 Jun 12, 2017
@lilgreenbird lilgreenbird added this to Closed/Merged PRs in MSSQL JDBC Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

None yet

6 participants