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

Metadata caching #345

Merged
merged 38 commits into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0a52a12
Caching to avoid reparsing SQL text
TobiasSQL Apr 27, 2017
c886dcf
Minor clean-up for SQL text caching.
TobiasSQL Apr 27, 2017
ed144a4
Cache methods should be private.
TobiasSQL Apr 27, 2017
418528b
Actual clean-up, reverted invalid commit.
TobiasSQL Apr 27, 2017
4202e45
Added prototype for prepared statment handle cache.
TobiasSQL Apr 30, 2017
1856ef5
Removed unnec. parsing per Brett's comment
TobiasSQL Apr 30, 2017
503f539
Updated prototype for statement and parameter metadata pooling.
TobiasSQL May 4, 2017
ca3c84e
Merge branch 'dev' into metadataCaching
TobiasSQL May 4, 2017
f896542
Fix re-use of parameter metadata with closed parent statement.
TobiasSQL May 4, 2017
dab1c6b
SHA1 hash of SQL as cache key
TobiasSQL May 4, 2017
dbc9522
Undo use of hash for statement pooling key.
TobiasSQL May 4, 2017
0e8b9aa
Replaced Guava with CLHM + SHA1 hash
TobiasSQL May 5, 2017
99519b1
Replaced Guava with CLHM + SHA1 hash
TobiasSQL May 5, 2017
f89d740
Clean-up
TobiasSQL May 6, 2017
baf5544
Fixed eviction bug and added eviction test case.
TobiasSQL May 7, 2017
8f50fb7
Additional test case + ability to change pool size
TobiasSQL May 7, 2017
12f94cf
Merge of @brettwooldridge's changes
TobiasSQL May 8, 2017
3d5ba9b
Update SQLServerPreparedStatement.java
TobiasSQL May 9, 2017
069d2cf
Cleaned up and simplified ref counting.
TobiasSQL May 15, 2017
86e15f2
Updated comments + race condition test from Brett
TobiasSQL May 15, 2017
8f4b090
Merge branch 'metadataCaching' of https://github.com/Microsoft/mssql-…
TobiasSQL May 15, 2017
3b1159c
Fixed issues related to cursors, clean-up.
TobiasSQL May 16, 2017
c989b29
Removed use of lamba expression in test case.
TobiasSQL May 16, 2017
224ccd0
Re-run tests, random failure...
TobiasSQL May 16, 2017
ed1c9fe
Fixed several bugs related to invalid handle re-use.
TobiasSQL May 25, 2017
ba3bae2
Fixed test case.
TobiasSQL May 25, 2017
970652e
Updated test case to run for JDBC42
TobiasSQL May 26, 2017
20498eb
Moved com.googlecode to mssql.googlecode to avoid naming conflicts
TobiasSQL May 26, 2017
e4bc0d8
getPreparedStatementHandle() should not be allowed with closed statement
TobiasSQL May 26, 2017
3f44946
Fix for missing handle in batching case.
TobiasSQL May 29, 2017
ec96059
Attempt 2 to fix batching issue with statement caching.
TobiasSQL May 30, 2017
bac85ff
Testing only
TobiasSQL May 30, 2017
38e187f
Attempt 3 (and a half)... :-/ (final Dragon)
TobiasSQL May 30, 2017
abc1a64
Attempt 4...
TobiasSQL May 30, 2017
95f5a27
Actual fix :-)
TobiasSQL May 30, 2017
4bf4c0c
Finally fixed batching error with prepared handle including repro test
TobiasSQL May 31, 2017
38da794
Re-use "executedAtLeastOnce" across connections per Brett's suggestion
TobiasSQL May 31, 2017
24913f0
Merge branch 'RTW_6.2.0' into metadataCaching
TobiasSQL Jun 16, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local.properties
.classpath
.vscode/
.settings/
.gradle/
.loadpath

# External tool builders
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ repositories {
dependencies {
compile 'com.microsoft.azure:azure-keyvault:0.9.7',
'com.microsoft.azure:adal4j:1.1.3'

testCompile 'junit:junit:4.12',
'org.junit.platform:junit-platform-console:1.0.0-M3',
'org.junit.platform:junit-platform-commons:1.0.0-M3',
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.6.0</version>
<version>2.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/ParsedSQLMetadata.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Microsoft JDBC Driver for SQL Server
*
* Copyright(c) Microsoft Corporation All rights reserved.
*
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information.
*/

package com.microsoft.sqlserver.jdbc;

/**
* Used for caching of meta data from parsed SQL text.
*/
final class ParsedSQLCacheItem {
/** The SQL text AFTER processing. */
String processedSQL;
int parameterCount;
String procedureName;
boolean bReturnValueSyntax;

ParsedSQLCacheItem(String processedSQL, int parameterCount, String procedureName, boolean bReturnValueSyntax) {
this.processedSQL = processedSQL;
this.parameterCount = parameterCount;
this.procedureName = procedureName;
this.bReturnValueSyntax = bReturnValueSyntax;
}
}

Loading