Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ void disableSSL() {
* The mission: To close the SSLSocket and release everything that it is holding onto other than the TCP/IP socket and streams.
*
* The challenge: Simply closing the SSLSocket tries to do additional, unnecessary shutdown I/O over the TCP/IP streams that are bound to the
* socket proxy, resulting in a hang and confusing SQL Server.
* socket proxy, resulting in a not responding and confusing SQL Server.
*
* Solution: Rewire the ProxySocket's input and output streams (one more time) to closed streams. SSLSocket sees that the streams are already
* closed and does not attempt to do any further I/O on them before closing itself.
Expand Down Expand Up @@ -2547,7 +2547,7 @@ private void findSocketUsingJavaNIO(InetAddress[] inetAddrs,
+ " occured while processing the channel: " + ch);
updateSelectedException(ex, this.toString());
// close the channel pro-actively so that we do not
// hang on to network resources
// rely to network resources
ch.close();
}

Expand Down Expand Up @@ -7630,8 +7630,8 @@ final void onResponseEOM() throws SQLServerException {
// interrupting threads. Note that it is remotely possible that the call
// to readPacket won't actually read anything if the attention ack was
// already read by TDSCommand.detach(), in which case this method could
// be called from multiple threads, leading to a benign race to clear the
// readingResponse flag.
// be called from multiple threads, leading to a benign followup process
// to clear the readingResponse flag.
if (readAttentionAck)
tdsReader.readPacket();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public boolean isRealmValid(String realm) {
validator = oracleRealmValidator;
// As explained here: https://github.com/Microsoft/mssql-jdbc/pull/40#issuecomment-281509304
// The default Oracle Resolution mechanism is not bulletproof
// If it resolves a crappy name, drop it.
// If it resolves a non-existing name, drop it.
if (!validator.isRealmValid("this.might.not.exist." + hostnameToTest)) {
// Our realm validator is well working, return it
authLogger.fine("Kerberos Realm Validator: Using Built-in Oracle Realm Validation method.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,9 +1446,9 @@ Object readResolve() {
* provides a flexible approach for constructing customized instances with
* a named parameter syntax. It can be used in the following manner:
* <pre>{@code
* ConcurrentMap<Vertex, Set<Edge>> graph = new Builder<Vertex, Set<Edge>>()
* ConcurrentMap<Vertex, Set<G>> graph = new Builder<Vertex, Set<G>>()
* .maximumWeightedCapacity(5000)
* .weigher(Weighers.<Edge>set())
* .weigher(Weighers.<G>set())
* .build();
* }</pre>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/samples/resultsets/src/main/java/retrieveRS.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static void createTable(Connection con) throws SQLException {

stmt.execute(sql);

sql = "INSERT Product_JDBC_Sample VALUES ('Adjustable Race','AR-5381','0','0',NULL,'1000','750','0.00','0.00',NULL,NULL,NULL,NULL,'0',NULL,NULL,NULL,NULL,NULL,'2008-04-30 00:00:00.000',NULL,NULL,'694215B7-08F7-4C0D-ACB1-D734BA44C0C8','2014-02-08 10:01:36.827') ";
sql = "INSERT Product_JDBC_Sample VALUES ('Adjustable Time','AR-5381','0','0',NULL,'1000','750','0.00','0.00',NULL,NULL,NULL,NULL,'0',NULL,NULL,NULL,NULL,NULL,'2008-04-30 00:00:00.000',NULL,NULL,'694215B7-08F7-4C0D-ACB1-D734BA44C0C8','2014-02-08 10:01:36.827') ";
stmt.execute(sql);

sql = "INSERT Product_JDBC_Sample VALUES ('ML Bottom Bracket','BB-8107','0','0',NULL,'1000','750','0.00','0.00',NULL,NULL,NULL,NULL,'0',NULL,NULL,NULL,NULL,NULL,'2008-04-30 00:00:00.000',NULL,NULL,'694215B7-08F7-4C0D-ACB1-D734BA44C0C8','2014-02-08 10:01:36.827') ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ public void inputParamsTest() throws SQLException {

// the historical way: no leading '@', parameter names respected (not positional)
CallableStatement cs1 = connection.prepareCall(call);
cs1.setString("p2", "bar");
cs1.setString("p1", "foo");
cs1.setString("p2", "world");
cs1.setString("p1", "hello");
rs = cs1.executeQuery();
rs.next();
assertEquals("foobar", rs.getString(1));
assertEquals("helloworld", rs.getString(1));

// the "new" way: leading '@', parameter names still respected (not positional)
CallableStatement cs2 = connection.prepareCall(call);
Expand All @@ -150,7 +150,7 @@ public void inputParamsTest() throws SQLException {
// sanity check: unrecognized parameter name
CallableStatement cs3 = connection.prepareCall(call);
try {
cs3.setString("@whatever", "junk");
cs3.setString("@whatever", "test");
fail("SQLServerException should have been thrown");
} catch (SQLServerException sse) {
if (!sse.getMessage().startsWith("Parameter @whatever was not defined")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class MergeTest extends AbstractTest {
+ " SELECT * FROM CricketTeams IF OBJECT_ID (N'dbo.CricketTeams_UpdatedList', N'U') IS NOT NULL DROP TABLE dbo.CricketTeams_UpdatedList;"
+ " CREATE TABLE dbo.CricketTeams_UpdatedList ( CricketTeamID tinyint NOT NULL PRIMARY KEY, CricketTeamCountry nvarchar(30), CricketTeamContinent nvarchar(50))"
+ "INSERT INTO dbo.CricketTeams_UpdatedList VALUES (1, 'Australia', 'Australia'), (2, 'India', 'Asia'), (3, 'Pakistan', 'Asia'), (4, 'Srilanka', 'Asia'), (5, 'Bangaladesh', 'Asia'),"
+ " (6, 'Hong Kong', 'Asia'), (8, 'England', 'Europe'), (9, 'South Africa', 'Africa'), (10, 'West Indies', 'North America'), (11, 'Zimbabwe', 'Africa');";
+ " (6, 'Thailand', 'Asia'), (8, 'England', 'Europe'), (9, 'South Africa', 'Africa'), (10, 'West Indies', 'North America'), (11, 'Zimbabwe', 'Africa');";

private static final String mergeCmd2 = "MERGE dbo.CricketTeams AS TARGET " + "USING dbo.CricketTeams_UpdatedList AS SOURCE "
+ "ON (TARGET.CricketTeamID = SOURCE.CricketTeamID) " + "WHEN MATCHED AND TARGET.CricketTeamContinent <> SOURCE.CricketTeamContinent OR "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public void testCancelBlockedResponse() throws Exception {

try {
// Start a transaction on a second connection that locks the last part of the table
// and leave it hanging for now...
// and leave it non-responsive for now...
conLock = DriverManager.getConnection(connectionString);
conLock.setAutoCommit(false);
stmtLock = conLock.createStatement();
Expand Down Expand Up @@ -434,7 +434,7 @@ public void testCancelBlockedResponsePS() throws Exception {

try {
// Start a transaction on a second connection that locks the last part of the table
// and leave it hanging for now...
// and leave it non-responsive for now...
conLock = DriverManager.getConnection(connectionString);
conLock.setAutoCommit(false);
stmtLock = conLock.createStatement();
Expand Down Expand Up @@ -551,7 +551,7 @@ public void testCancelBlockedCursoredResponse() throws Exception {

try {
// Start a transaction on a second connection that locks the last part of the table
// and leave it hanging for now...
// and leave it non-responsive for now...
conLock = DriverManager.getConnection(connectionString);
conLock.setAutoCommit(false);
stmtLock = conLock.createStatement();
Expand Down Expand Up @@ -726,11 +726,11 @@ public void testCancelGetOutParams() throws Exception {
/**
* Test that tries to flush out cancellation synchronization issues by repeatedly executing and cancelling statements on multiple threads.
*
* Typical expected failures would be liveness issues (which would manifest as a test hang), incorrect results, or TDS corruption problems.
* Typical expected failures would be liveness issues (which would manifest as a test being non-responsive), incorrect results, or TDS corruption problems.
*
* A set of thread pairs runs for 10 seconds. Each pair has one thread repeatedly executing a SELECT statement and one thread repeatedly
* cancelling execution of that statement. Nothing is done to validate whether any particular call to cancel had any affect on the statement.
* Liveness issues typically would manifest as a hang in this test.
* Liveness issues typically would manifest as a no response in this test.
*
* In order to maximize the likelihood of this test finding bugs, it should run on a multi-proc machine with the -server flag specified to the
* JVM. Also, the debugging println statements are commented out deliberately to minimize the impact to the test from the diagnostics, which
Expand Down