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

Open Connection Retry #1535

Merged
merged 61 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c97b863
Fix AEv2 tests exclude for reqExternalSetup and cleanup (#1247)
lilgreenbird Feb 5, 2020
54b5a19
Fix | Add null check for getObject() with LocalTime and LocalDate (#1…
peterbae Feb 8, 2020
672b7d6
added all AKV tests to use reqExternalSetup tag so they will be skipp…
lilgreenbird Feb 10, 2020
3c3331b
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Mar 25, 2020
e2c5640
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Mar 26, 2020
aad6966
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Mar 28, 2020
92bf04c
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Mar 31, 2020
3ba5ab7
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Apr 4, 2020
d20823d
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Apr 7, 2020
4cc959f
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Apr 29, 2020
7b301f8
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Apr 30, 2020
56bcf13
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird May 7, 2020
744e0ca
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird May 12, 2020
df8fd41
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird May 19, 2020
652e68b
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird May 26, 2020
53736db
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird May 26, 2020
9ba6a42
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 2, 2020
6d156f7
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 5, 2020
e08ffe5
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 10, 2020
6b6cab2
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 18, 2020
c202590
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 24, 2020
0515d4b
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 24, 2020
2c63b58
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jun 25, 2020
78aa941
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jul 2, 2020
90e99cd
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jul 2, 2020
da1004b
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jul 6, 2020
9ca1284
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jul 28, 2020
c67d8ed
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Aug 1, 2020
1d0a4ad
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Aug 5, 2020
f1b1dfb
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Aug 26, 2020
d9bad87
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Sep 2, 2020
a2e50b9
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Sep 9, 2020
7ff97de
enable ADintegrated tests for non-windows
lilgreenbird Sep 9, 2020
7cae3b4
fixed user test for kerberos
lilgreenbird Sep 11, 2020
c8c5a29
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Sep 16, 2020
d76368a
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Sep 22, 2020
e5aafd3
Merge branch 'dev' of https://github.com/lilgreenbird/mssql-jdbc into…
lilgreenbird Sep 22, 2020
7800824
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Oct 5, 2020
a8199bb
merged
lilgreenbird Oct 14, 2020
3a91ea1
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Oct 16, 2020
3e39be1
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Oct 28, 2020
16d2bbd
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Nov 28, 2020
f9d22e9
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Dec 2, 2020
8eeb9a6
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Dec 8, 2020
465219f
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jan 8, 2021
dc836d0
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jan 12, 2021
0c9a08c
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Jan 13, 2021
ab9b2f2
Merge remote-tracking branch 'upstream/dev' into dev
lilgreenbird Feb 11, 2021
bea92b8
Merge remote-tracking branch 'upstream/dev' into retry
lilgreenbird Mar 4, 2021
0d63f20
open connection retry
lilgreenbird Mar 9, 2021
45426d2
update
lilgreenbird Mar 9, 2021
48eaace
update
lilgreenbird Mar 9, 2021
d235f76
add debug
lilgreenbird Mar 9, 2021
6818b39
add debug
lilgreenbird Mar 9, 2021
f39d58f
fixed
lilgreenbird Mar 9, 2021
dd376cc
timeout
lilgreenbird Mar 9, 2021
0a5f0ef
update
lilgreenbird Mar 10, 2021
2ae0371
fixed test
lilgreenbird Mar 10, 2021
6e8421b
fixed typo
lilgreenbird Mar 10, 2021
2221a8c
clean up
lilgreenbird Mar 10, 2021
79ba78d
review updates
lilgreenbird Mar 18, 2021
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
Next Next commit
Fix AEv2 tests exclude for reqExternalSetup and cleanup (#1247)
  • Loading branch information
lilgreenbird authored Feb 5, 2020
commit c97b863c95385bdcd1afc897ef39cbebaf495578

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.microsoft.sqlserver.jdbc.SQLServerStatement;
import com.microsoft.sqlserver.jdbc.TestResource;
import com.microsoft.sqlserver.jdbc.TestUtils;
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
import com.microsoft.sqlserver.testframework.Constants;
import com.microsoft.sqlserver.testframework.PrepUtil;

Expand Down Expand Up @@ -850,11 +849,10 @@ public void testAEFMTOnly(String serverName, String url, String protocol) throws
checkAESetup(serverName, url, protocol);
try (SQLServerConnection c = PrepUtil.getConnection(AETestConnectionString + ";useFmtOnly=true", AEInfo);
Statement s = c.createStatement()) {
dropTables(s);
createTable(NUMERIC_TABLE_AE, cekJks, numericTable);
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE) + " values( "
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
+ "?,?,?," + "?,?,?," + "?,?,?" + ")";
try (PreparedStatement p = c.prepareStatement(sql)) {
ParameterMetaData pmd = p.getParameterMetaData();
assertTrue(pmd.getParameterCount() == 48);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.microsoft.sqlserver.jdbc.SQLServerStatement;
import com.microsoft.sqlserver.jdbc.TestResource;
import com.microsoft.sqlserver.jdbc.TestUtils;
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
import com.microsoft.sqlserver.testframework.Constants;
import com.microsoft.sqlserver.testframework.PrepUtil;

Expand Down Expand Up @@ -214,8 +213,8 @@ public void testDateScale5Null(String serverName, String url, String protocol) t

private void testNumeric(String[] numeric) throws SQLException {
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerStatement stmt = (SQLServerStatement) con.createStatement(); ResultSet rs = stmt
.executeQuery("select * from " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE))) {
SQLServerStatement stmt = (SQLServerStatement) con.createStatement();
ResultSet rs = stmt.executeQuery("select * from " + NUMERIC_TABLE_AE)) {
int numberOfColumns = rs.getMetaData().getColumnCount();

ArrayList<Integer> skipMax = new ArrayList<>();
Expand All @@ -230,8 +229,8 @@ private void testNumeric(String[] numeric) throws SQLException {

private void testDate(String[] dateNormalCase, String[] dateSetObject) throws Exception {
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerStatement stmt = (SQLServerStatement) con.createStatement(); ResultSet rs = stmt
.executeQuery("select * from " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE))) {
SQLServerStatement stmt = (SQLServerStatement) con.createStatement();
ResultSet rs = stmt.executeQuery("select * from " + DATE_TABLE_AE)) {
int numberOfColumns = rs.getMetaData().getColumnCount();

ArrayList<Integer> skipMax = new ArrayList<>();
Expand Down Expand Up @@ -397,8 +396,8 @@ private void testGetDate(ResultSet rs, int numberOfColumns, String[] dates) thro
}

private void populateDate(int scale) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE) + " values( " + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
String sql = "insert into " + DATE_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?" + ")";

try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
Expand Down Expand Up @@ -477,8 +476,8 @@ private void populateDate(int scale) throws SQLException {
}

private void populateDateNormalCaseNull(int scale) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE) + " values( " + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
String sql = "insert into " + DATE_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?" + ")";

try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
Expand Down Expand Up @@ -520,8 +519,7 @@ private void populateDateNormalCaseNull(int scale) throws SQLException {
}

private void populateNumeric(String[] numeric, int precision, int scale) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE) + " values( " + "?,?,?,"
+ "?,?,?," + "?,?,?" + ")";
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?" + ")";
try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
stmtColEncSetting)) {
Expand Down Expand Up @@ -578,8 +576,7 @@ private void populateNumeric(String[] numeric, int precision, int scale) throws
}

private void populateNumericSetObjectNull(int precision, int scale) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE) + " values( " + "?,?,?,"
+ "?,?,?," + "?,?,?" + ")";
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?" + ")";

try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
Expand All @@ -606,8 +603,8 @@ private void populateNumericSetObjectNull(int precision, int scale) throws SQLEx
}

private void populateDateSetObjectNull(int scale) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE) + " values( " + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";
String sql = "insert into " + DATE_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?" + ")";

try (SQLServerConnection con = PrepUtil.getConnection(AETestConnectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.junit.runners.Parameterized;

import com.microsoft.sqlserver.jdbc.TestUtils;
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
import com.microsoft.sqlserver.testframework.Constants;
import com.microsoft.sqlserver.testframework.PrepUtil;

Expand Down Expand Up @@ -99,8 +98,7 @@ public void alwaysEncrypted2(String serverName, String url, String protocol) thr
}

private void populateDateTable(Connection connection) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE) + " values( " + "?,?,?"
+ ")";
String sql = "insert into " + DATE_TABLE_AE + " values( " + "?,?,?" + ")";
try (PreparedStatement sqlPstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, connection.getHoldability())) {
sqlPstmt.setObject(1, Constants.DATE);
Expand All @@ -111,8 +109,7 @@ private void populateDateTable(Connection connection) throws SQLException {
}

private void populateCharTable(Connection connection) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(CHAR_TABLE_AE) + " values( " + "?,?,?,?,?,?"
+ ")";
String sql = "insert into " + CHAR_TABLE_AE + " values( " + "?,?,?,?,?,?" + ")";
try (PreparedStatement sqlPstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, connection.getHoldability())) {
sqlPstmt.setObject(1, "hi");
Expand All @@ -126,8 +123,7 @@ private void populateCharTable(Connection connection) throws SQLException {
}

private void populateNumericTable(Connection connection) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE)
+ " values(?,?,?,?,?,?,?,?,?)";
String sql = "insert into " + NUMERIC_TABLE_AE + " values(?,?,?,?,?,?,?,?,?)";
try (PreparedStatement sqlPstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, connection.getHoldability())) {
sqlPstmt.setObject(1, true);
Expand All @@ -145,8 +141,7 @@ private void populateNumericTable(Connection connection) throws SQLException {
}

private void populateNumericTableSpecificSetter(Connection connection) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE) + " values( "
+ "?,?,?,?,?,?,?,?,?" + ")";
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?,?,?,?,?,?,?" + ")";
try (PreparedStatement sqlPstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, connection.getHoldability())) {
sqlPstmt.setBoolean(1, true);
Expand All @@ -164,8 +159,7 @@ private void populateNumericTableSpecificSetter(Connection connection) throws SQ
}

private void populateNumericTableWithNull(Connection connection) throws SQLException {
String sql = "insert into " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE) + " values( " + "?,?,?"
+ ",?,?,?" + ",?,?,?" + ")";
String sql = "insert into " + NUMERIC_TABLE_AE + " values( " + "?,?,?" + ",?,?,?" + ",?,?,?" + ")";
try (PreparedStatement sqlPstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, connection.getHoldability())) {
sqlPstmt.setObject(1, null, java.sql.Types.BIT);
Expand All @@ -183,8 +177,7 @@ private void populateNumericTableWithNull(Connection connection) throws SQLExcep

private void verifyDateTable(Connection connection) throws SQLException {
try (Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt
.executeQuery("select * from " + AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE))) {
ResultSet rs = stmt.executeQuery("select * from " + DATE_TABLE_AE)) {
while (rs.next()) {
// VSTS BUG 5268
// assertEquals(date.getTime(), ((Date) rs.getObject(1)).getTime());
Expand All @@ -194,8 +187,7 @@ private void verifyDateTable(Connection connection) throws SQLException {

private void verifyCharTable(Connection connection) throws SQLException {
try (Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt
.executeQuery("select * from " + AbstractSQLGenerator.escapeIdentifier(CHAR_TABLE_AE))) {
ResultSet rs = stmt.executeQuery("select * from " + CHAR_TABLE_AE)) {
while (rs.next()) {
assertEquals("hi ", rs.getObject(1));
assertEquals("sample ", rs.getObject(2));
Expand All @@ -209,8 +201,7 @@ private void verifyCharTable(Connection connection) throws SQLException {

private void verifyNumericTable(Connection connection, boolean isNull) throws SQLException {
try (Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt
.executeQuery("select * from " + AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE))) {
ResultSet rs = stmt.executeQuery("select * from " + NUMERIC_TABLE_AE)) {
while (rs.next()) {
if (isNull) {
assertEquals(null, rs.getObject(1));
Expand Down Expand Up @@ -238,8 +229,8 @@ private void verifyNumericTable(Connection connection, boolean isNull) throws SQ
}

public static void dropTables(Statement stmt) throws SQLException {
TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(DATE_TABLE_AE), stmt);
TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(CHAR_TABLE_AE), stmt);
TestUtils.dropTableIfExists(AbstractSQLGenerator.escapeIdentifier(NUMERIC_TABLE_AE), stmt);
TestUtils.dropTableIfExists(DATE_TABLE_AE, stmt);
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
TestUtils.dropTableIfExists(NUMERIC_TABLE_AE, stmt);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public static void setup() throws Exception {
prop = getConfiguredProperty("enclaveServer", null);
if (null == prop) {
// default to server in connection string
String serverName = connectionString.substring(Constants.JDBC_PREFIX.length())
.split(Constants.SEMI_COLON)[0];
String serverName = (connectionString.substring(Constants.JDBC_PREFIX.length())
.split(Constants.SEMI_COLON)[0]).split(":")[0];
enclaveServer = new String[1];
enclaveServer[0] = new String(serverName);
} else {
Expand Down