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

Fix | Fix batch insert failing when AE is turned on #1378

Merged
merged 4 commits into from
Jul 3, 2020

Conversation

peterbae
Copy link
Contributor

@peterbae peterbae commented Jul 2, 2020

Fixes issue #1301. Testing shows it also fixes #1360, but will need to confirm from user.

Continues from PR #1334. Testing has been carried over, but the fix is different.

The problem was coming from executing sp_describe_parameter_encryption. This statement is executed when AE is turned on to retrieve the encryption parameter. Code was currently written in such a way that sp_describe_paramter_encryption was being executed twice (or multiple times) if AE was enabled, which caused the driver to think that the current request was completed, which caused the driver to error out during the actual execution of the batch statement (and a plethora of other problems). Adding logic to only run param fetch once and save the encryption metadata for the subsequent batches as well solves this problem.

Before: (PrecisionScaleTest::testMultiBatch)
image

After:
image

Testing was done against with both AE and AEv2 enabled.

@ulvii ulvii merged commit 6f5ecb7 into microsoft:dev Jul 3, 2020
@lilgreenbird lilgreenbird added this to Closed/Merged PRs in MSSQL JDBC Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

can not insert into a table with always encrypted cols using executeBatch
4 participants