Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
4213afc
TimeoutTimer: Check for destroyed TheadGroup
mnhubspot Sep 1, 2017
9da95c5
TimeoutTimer: Forgot reference
mnhubspot Sep 1, 2017
6789eb6
recognize CallableStatement parameter names with leading '@'
gordthompson Sep 20, 2017
0b410f0
Replace manual array copy
JamieMagee Sep 22, 2017
16bd589
Remove redundant String.toString()
JamieMagee Sep 22, 2017
d94cccc
Replace bare literals
JamieMagee Sep 22, 2017
6f262f8
cleanup tables after test
AfsanehR-zz Sep 25, 2017
328feec
more cleaning of tables and procedures
AfsanehR-zz Sep 25, 2017
e77a046
Implement checkDuplicateColumnName to check duplicate columns
peterbae Sep 26, 2017
8f69956
Revert "Implement checkDuplicateColumnName to check duplicate columns"
peterbae Sep 27, 2017
f8e89df
Revert "Revert "Implement checkDuplicateColumnName to check duplicate…
peterbae Sep 27, 2017
91a3eea
Apply same logic for TVP
peterbae Sep 27, 2017
fe83139
use try with resources
AfsanehR-zz Oct 2, 2017
7f18810
add another try-with-resource
AfsanehR-zz Oct 2, 2017
d778a6f
drop a not needed method
AfsanehR-zz Oct 2, 2017
ada51de
try-with-resources implementation commit 1
cheenamalhotra Oct 2, 2017
5b2657c
Update .travis.yml
cheenamalhotra Oct 2, 2017
7efd39f
Update .travis.yml
cheenamalhotra Oct 2, 2017
052b4b5
Fix AESetup issue with dropCEK
cheenamalhotra Oct 3, 2017
a94cb96
Merge branch 'dev' of https://github.com/Microsoft/mssql-jdbc into cl…
AfsanehR-zz Oct 3, 2017
5ef8dea
try-with-resources implementation commit 2
cheenamalhotra Oct 3, 2017
889f160
Merge branch 'dev' into JavaImprovements
cheenamalhotra Oct 3, 2017
55641c8
avoid creating connection for termination
AfsanehR-zz Oct 5, 2017
8c0ebf2
remove null check and change Set object name
peterbae Oct 5, 2017
b00b377
Merge pull request #509 from v-afrafi/cleanupTables
AfsanehR-zz Oct 5, 2017
e2ec02e
tweak to preserve original parameter name for exception message
gordthompson Oct 6, 2017
d4eadd6
Check for "Account Locked" SQL Exception 18486 while connecitng to SQ…
cheenamalhotra Oct 6, 2017
4a1409a
Updated comment for Locked User Account in SQLServerConnection.java
cheenamalhotra Oct 6, 2017
adf10ea
Refactoring the logic for checking duplicate column into Util class a…
peterbae Oct 6, 2017
e5f7c6c
Merge pull request #501 from JamieMagee/redundant-String-toString
AfsanehR-zz Oct 7, 2017
b8daa42
Merge pull request #495 from gordthompson/allow-at-sign-prefixed-para…
AfsanehR-zz Oct 7, 2017
4b93851
Remove explicit interface reference
JamieMagee Oct 10, 2017
de471e7
Merge branch 'dev' into JavaImprovements
cheenamalhotra Oct 10, 2017
eb7efe3
Modified bvtTests to be able to test resultSet closing explicitly.
cheenamalhotra Oct 10, 2017
e7b68fd
Merge pull request #520 from cheenamalhotra/JavaImprovements
cheenamalhotra Oct 10, 2017
7a0fe66
Merge pull request #514 from peterbae/SQLServerDataTableImprovement-497
peterbae Oct 11, 2017
06cb754
Merge pull request #474 from maiken2051/master
cheenamalhotra Oct 12, 2017
92aa789
updates gradle dependencies
newnewcoder Oct 16, 2017
e51ea73
Merge pull request #502 from JamieMagee/replace-bare-literals
AfsanehR-zz Oct 17, 2017
fba39c8
Merge pull request #500 from JamieMagee/manual-array-copy
peterbae Oct 17, 2017
94ae4bf
6.3.4 release (#528)
ulvii Oct 18, 2017
a10b9d7
Add 6.3.5-SNAPSHOT to pom file (#530)
ulvii Oct 19, 2017
f52e6c7
Merge pull request #526 from newnewcoder/dev
xiangyushawn Oct 24, 2017
5693c39
revise the way that pom file uses version number
xiangyushawn Oct 27, 2017
c231b11
add -preview
xiangyushawn Oct 27, 2017
5c75147
Merge pull request #535 from v-xiangs/xiangs-update-POM-file
xiangyushawn Oct 27, 2017
93e0b18
Fix for static logger member in abstract class 'SQLServerClobBase'
cheenamalhotra Nov 1, 2017
5940cfc
fix handle not fund bug for metadata caching
xiangyushawn Nov 3, 2017
97a5cfc
fix tests
xiangyushawn Nov 3, 2017
9ffd521
fix failures in requesthandling test
xiangyushawn Nov 4, 2017
2cbd065
remove prepStmtHandle = -1 which disables metadata caching, and added…
xiangyushawn Nov 6, 2017
ab68580
remove fix for BatchTriggerTest, it breaks PreparedStatementTest
xiangyushawn Nov 6, 2017
5c74751
fix hasPreparedStatementHandle()
xiangyushawn Nov 6, 2017
9a54b6b
add the fix for batch trigger
xiangyushawn Nov 6, 2017
705ebc1
fix "handle is not valid" error. If context changed once, metadata ca…
xiangyushawn Nov 7, 2017
3ccdf0f
clear cached prepared statement handle when pooled connection is removed
xiangyushawn Nov 8, 2017
8559a33
merge the fix of batch trigger
xiangyushawn Nov 9, 2017
1839edc
change back the test to catch BatchUpdateException exception
xiangyushawn Nov 9, 2017
875f62a
disable metadata caching after switching database on connection directly
xiangyushawn Nov 9, 2017
df89f02
process all batch first, then throw batch exception is there is one, …
xiangyushawn Nov 11, 2017
4be9856
Merge pull request #537 from cheenamalhotra/staticLoggerQuery
cheenamalhotra Nov 15, 2017
be14e88
Merge pull request #522 from cheenamalhotra/throwAccountLockedEx
cheenamalhotra Nov 15, 2017
1992eed
re-enable metadata caching after context change
xiangyushawn Nov 17, 2017
7e1f663
Merge pull request #543 from v-xiangs/fix-metadata-cache-2
xiangyushawn Nov 17, 2017
8d6d446
Updated Changelog for 6.3.5 Release
cheenamalhotra Nov 17, 2017
8f15e20
Merge pull request #554 from cheenamalhotra/dev
cheenamalhotra Nov 17, 2017
62227e3
Merge branch 'master' into dev
cheenamalhotra Nov 17, 2017
91e7d8a
Update pom.xml
cheenamalhotra Nov 17, 2017
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)

## [6.3.5] Preview Release
### Added
- Added handle for Account Locked Exception 18486 during login in SQLServerConnection [#522](https://github.com/Microsoft/mssql-jdbc/pull/522)

### Fixed Issues
- Fixed the issues with Prepared Statement Metadata Caching implementation [#543](https://github.com/Microsoft/mssql-jdbc/pull/543)
- Fixed issues with static logger member in abstract class 'SQLServerClobBase' [#537](https://github.com/Microsoft/mssql-jdbc/pull/537)

## [6.3.4] Preview Release
### Added
- Added new ThreadGroup creation to prevent IllegalThreadStateException if the underlying ThreadGroup has been destroyed. [#474](https://github.com/Microsoft/mssql-jdbc/pull/474)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ To get the latest preview version of the driver, add the following to your POM f
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.4.jre8-preview</version>
<version>6.3.5.jre8-preview</version>
</dependency>
```

Expand Down Expand Up @@ -120,7 +120,7 @@ Projects that require either of the two features need to explicitly declare the
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.4.jre8-preview</version>
<version>6.3.5.jre8-preview</version>
<scope>compile</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repositories {
}

dependencies {
compile 'com.microsoft.azure:azure-keyvault:0.9.7',
compile 'com.microsoft.azure:azure-keyvault:1.0.0',
'com.microsoft.azure:adal4j:1.1.3'

testCompile 'junit:junit:4.12',
Expand Down
16 changes: 12 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.3.4</version>

<version>6.3.5.${jreVersion}-preview</version>
<packaging>jar</packaging>

<name>Microsoft JDBC Driver for SQL Server</name>
Expand Down Expand Up @@ -140,6 +139,11 @@
<profiles>
<profile>
<id>build41</id>

<properties>
<jreVersion>jre7</jreVersion>
</properties>

<build>
<plugins>
<plugin>
Expand All @@ -158,7 +162,6 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<finalName>${project.artifactId}-${project.version}.jre7-preview</finalName>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
Expand All @@ -171,9 +174,15 @@

<profile>
<id>build42</id>

<activation>
<activeByDefault>true</activeByDefault>
</activation>

<properties>
<jreVersion>jre8</jreVersion>
</properties>

<build>
<plugins>
<plugin>
Expand All @@ -192,7 +201,6 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<finalName>${project.artifactId}-${project.version}.jre8-preview</finalName>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
final class SQLJdbcVersion {
static final int major = 6;
static final int minor = 3;
static final int patch = 4;
static final int patch = 5;
static final int build = 0;
}
15 changes: 6 additions & 9 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerClob.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
public class SQLServerClob extends SQLServerClobBase implements Clob {
private static final long serialVersionUID = 2872035282200133865L;

// Loggers should be class static to avoid lock contention with multiple threads
private static final Logger logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerClob");

/**
* Create a new CLOB
*
Expand All @@ -50,19 +47,19 @@ public class SQLServerClob extends SQLServerClobBase implements Clob {
@Deprecated
public SQLServerClob(SQLServerConnection connection,
String data) {
super(connection, data, (null == connection) ? null : connection.getDatabaseCollation(), logger, null);
super(connection, data, (null == connection) ? null : connection.getDatabaseCollation(), null);

if (null == data)
throw new NullPointerException(SQLServerException.getErrString("R_cantSetNull"));
}

SQLServerClob(SQLServerConnection connection) {
super(connection, "", connection.getDatabaseCollation(), logger, null);
super(connection, "", connection.getDatabaseCollation(), null);
}

SQLServerClob(BaseInputStream stream,
TypeInfo typeInfo) throws SQLServerException, UnsupportedEncodingException {
super(null, stream, typeInfo.getSQLCollation(), logger , typeInfo);
super(null, stream, typeInfo.getSQLCollation(), typeInfo);
}

final JDBCType getJdbcType() {
Expand Down Expand Up @@ -91,7 +88,9 @@ abstract class SQLServerClobBase implements Serializable {
private ArrayList<Closeable> activeStreams = new ArrayList<>(1);

transient SQLServerConnection con;
private static Logger logger;

private final Logger logger = Logger.getLogger(getClass().getName());

final private String traceID = getClass().getName().substring(1 + getClass().getName().lastIndexOf('.')) + ":" + nextInstanceID();

final public String toString() {
Expand Down Expand Up @@ -129,7 +128,6 @@ private String getDisplayClassName() {
SQLServerClobBase(SQLServerConnection connection,
Object data,
SQLCollation collation,
Logger logger,
TypeInfo typeInfo) {
this.con = connection;
if (data instanceof BaseInputStream) {
Expand All @@ -140,7 +138,6 @@ private String getDisplayClassName() {
}
this.sqlCollation = collation;
this.typeInfo = typeInfo;
SQLServerClobBase.logger = logger;

if (logger.isLoggable(Level.FINE)) {
String loggingInfo = (null != connection) ? connection.toString() : "null connection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@

// Note all the public functions in this class also need to be defined in SQLServerConnectionPoolProxy.
public class SQLServerConnection implements ISQLServerConnection {
boolean contextIsAlreadyChanged = false;
boolean contextChanged = false;

long timerExpire;
boolean attemptRefreshTokenLocked = false;

Expand Down Expand Up @@ -1991,6 +1994,7 @@ else if (null == currentPrimaryPlaceHolder) {
catch (SQLServerException sqlex) {
if ((SQLServerException.LOGON_FAILED == sqlex.getErrorCode()) // actual logon failed, i.e. bad password
|| (SQLServerException.PASSWORD_EXPIRED == sqlex.getErrorCode()) // actual logon failed, i.e. password isExpired
|| (SQLServerException.USER_ACCOUNT_LOCKED == sqlex.getErrorCode()) // actual logon failed, i.e. user account locked
|| (SQLServerException.DRIVER_ERROR_INVALID_TDS == sqlex.getDriverErrorCode()) // invalid TDS received from server
|| (SQLServerException.DRIVER_ERROR_SSL_FAILED == sqlex.getDriverErrorCode()) // failure negotiating SSL
|| (SQLServerException.DRIVER_ERROR_INTERMITTENT_TLS_FAILED == sqlex.getDriverErrorCode()) // failure TLS1.2
Expand Down Expand Up @@ -3079,6 +3083,8 @@ final void poolCloseEventNotify() throws SQLServerException {
checkClosed();
if (catalog != null) {
connectionCommand("use " + Util.escapeSQLId(catalog), "setCatalog");
contextIsAlreadyChanged = true;
contextChanged = true;
sCatalog = catalog;
}
loggerExternal.exiting(getClassNameLogging(), "setCatalog");
Expand Down Expand Up @@ -5760,6 +5766,12 @@ final void evictCachedPreparedStatementHandle(PreparedStatementHandle handle) {
preparedStatementHandleCache.remove(handle.getKey());
}

final void clearCachedPreparedStatementHandle() {
if (null != preparedStatementHandleCache) {
preparedStatementHandleCache.clear();
}
}

// Handle closing handles when removed from cache.
final class PreparedStatementCacheEvictionListener implements EvictionListener<Sha1HashKey, PreparedStatementHandle> {
public void onEviction(Sha1HashKey key, PreparedStatementHandle handle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ public void run() {
if (bIsOpen && (null != wrappedConnection)) {
if (wrappedConnection.getConnectionLogger().isLoggable(Level.FINER))
wrappedConnection.getConnectionLogger().finer(toString() + " Connection proxy closed ");

// clear cached prepared statement handle on this connection
wrappedConnection.clearCachedPreparedStatementHandle();
wrappedConnection.poolCloseEventNotify();
wrappedConnection = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public final class SQLServerException extends java.sql.SQLException {
// SQL error values (from sqlerrorcodes.h)
static final int LOGON_FAILED = 18456;
static final int PASSWORD_EXPIRED = 18488;
static final int USER_ACCOUNT_LOCKED = 18486;
static java.util.logging.Logger exLogger = java.util.logging.Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerException");

// Facility for driver-specific error codes
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerNClob.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@

import java.io.UnsupportedEncodingException;
import java.sql.NClob;
import java.util.logging.Logger;

/**
* SQLServerNClob represents a National Character Set LOB object and implements java.sql.NClob.
*/

public final class SQLServerNClob extends SQLServerClobBase implements NClob {
// Loggers should be class static to avoid lock contention with multiple threads
private static final Logger logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerNClob");

SQLServerNClob(SQLServerConnection connection) {
super(connection, "", connection.getDatabaseCollation(), logger, null);
private static final long serialVersionUID = 1L;

SQLServerNClob(SQLServerConnection connection) {
super(connection, "", connection.getDatabaseCollation(), null);
}

SQLServerNClob(BaseInputStream stream,
TypeInfo typeInfo) throws SQLServerException, UnsupportedEncodingException {
super(null, stream, typeInfo.getSQLCollation(), logger , typeInfo);
super(null, stream, typeInfo.getSQLCollation(), typeInfo);
}

final JDBCType getJdbcType() {
Expand Down
Loading