Migration from io.r2dbc:r2dbc-mssql
Change the groupId and keep the artifact id r2dbc-mssql. Remove the other driver. Then fix the URL and decide whether large values stay buffered.
Dependency
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-mssql</artifactId>
<version>1.0.7.RELEASE</version>
<groupId>org.mssqllib.r2dbc.mssql</groupId>
<artifactId>r2dbc-mssql</artifactId>
<version>1.0.1</version>
Gradle is the same coordinate change. A transitive copy of io.r2dbc:r2dbc-mssql still has to go. Both jars register a ConnectionFactoryProvider.
URL
r2dbc:sqlserver://host/database
r2dbc:mssql://host/database
r2dbc:mssql://user:password@host:1433/database?materializeLobs=true
This provider accepts mssql only. It requires the port. SQL password login requires the user and password when no token source is set. Add materializeLobs=true when the application reads varchar(max), nvarchar(max), varbinary(max), or xml as String or byte[]. Without it those reads throw. Leave it off to take the streaming path.
Calls that differ
returnGeneratedValuesthrowsUnsupportedOperationException. Select the new key withOUTPUT INSERTED.…in the statement text.setAutoCommitsendsSET IMPLICIT_TRANSACTIONS.isAutoCommitis true only when that mode is on and no transaction is open.setTransactionIsolationLevelsendsSET TRANSACTION ISOLATION LEVEL. The session starts at read committed.beginTransaction()keeps that session level. A begin that must name a different level usesbeginTransaction(TransactionDefinition). Commit and rollback put the session level back.setLockWaitTimeoutsendsSET LOCK_TIMEOUT.setStatementTimeoutis a client deadline until the first response and fails withR2dbcTimeoutExceptionwhen that response does not arrive.releaseSavepointsucceeds and does not talk to the server. A null or empty name throwsIllegalArgumentException. Create and rollback-to-savepoint do.createSavepointwith no transaction open turns auto-commit off and begins one.- A positive
fetchSizeopens a server cursor when the statement has at most one execution. Zero sends the statement directly. Confirm that a non-zero fetch size is still what you want. - Code that calls
row.getafterResult.mapreturns will run here.io.r2dbc:r2dbc-mssql1.0.7 throwsValue cannot be retrieved after row has been released. Move the read inside the callback if the code should stay portable. SUM(int)andAVG(int)are stillinton SQL Server and can raise 8115. Cast tobigintor useCOUNT_BIG. A nullParameters.outforBIGINTis sent as an 8-byte integer.
Authentication
A SQL user and password keep working with the URL above. Entra login is configured with the options on the authentication page. Do not put a JWT in the URL. Integrated authentication, interactive authentication, and managed identity are not implemented. ActiveDirectoryPassword does not perform an Azure AD password grant.
After the switch
Log the PRELOGIN encryption line if a session that works on localhost hangs on Azure. Local servers usually drop TLS after login. Azure SQL keeps it. A short failure with error 40613 is a paused database. The default login budget retries it. See login retry.
Live comparisons against SQL Server and Azure SQL are in the sibling MsSqlTesting project, not in this repository. That suite can run the same case on this driver, on this driver with materializeLobs forced on, or on io.r2dbc:r2dbc-mssql.