Batch fails when always encrypted is enabled in connection string
See original GitHub issueDriver version
8.2.2.jre11 (older versions are affected, too)
SQL Server version
Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) Mar 18 2018 09:11:49 Copyright © Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 18363: ) (Hypervisor)
Client Operating System
Windows/Linux
JAVA/JVM version
11.0.6
Table schema
Table will be created by test.
create table TEST2 (KEY1 numeric(19,0) not null, KEY2 numeric(19,0) not null, primary key (KEY1, KEY2))
Problem description
Prepare database with always encrypted feature. Update connection details in ExecuteBatchTest.java and run tests in attached gradle project.
- Expected behaviour: No column is encrypted, so it does not matter, whether columnEncryptionSetting is enabled or not.
- Actual behaviour: Only test with connection string containing “columnEncryptionSetting=Enabled” fails.
- Error message/stack trace:
java.lang.AssertionError at com.microsoft.sqlserver.jdbc.TDSCommand.onRequestComplete(IOBuffer.java:7397) at com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(IOBuffer.java:4071) at com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(IOBuffer.java:3185) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7556) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatementBatch(SQLServerPreparedStatement.java:2786) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtBatchExecCmd.doExecute(SQLServerPreparedStatement.java:2675) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2076) at ExecuteBatchTest.executeBatch(ExecuteBatchTest.java:65) at ExecuteBatchTest.test(ExecuteBatchTest.java:38)
- Any other details that can be helpful: Second batch fails.
JDBC trace logs
Reproduction code
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Using Always Encrypted - ODBC Driver for SQL Server
Enabling Always Encrypted in an ODBC application. The easiest way to enable both parameter encryption and resultset encrypted column decryption ...
Read more >How to configure Always Encrypted in SQL Server 2016 using ...
First, add Column Encryption Setting = Enabled in the Additional Connection Parameters in the SSMS Connect to Server window. Now, query the ...
Read more >Always Encrypted - Progress Documentation
When Always Encrypted is enabled, the driver uses the steps described in this section to retrieve keys and negotiate the decryption of encrypted...
Read more >Solved: SQL Server Always Encrypted and Alteryx
Also, your database connection string must contain ColumnEncryption=Enabled. This setting instructs ODBC to encrypt data targeting encrypted ...
Read more >Parameterization(Always Encrypted)- Inside stored proc
I have also enabled parameterization and also enabled column encryption setting for connection. Still getting the following error when creating ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
when will this fix be released?
Fixed in #1378.