V8 SQL Connection Changes
1 min
the following changes are required for upgrading there is a script in //resources/internal/upgrade/v8/fixsqlconnection that will do most of these changes for you change what to do the default connection string setting has changed from encrypt="false" to encrypt="true" this means that by default all connections are ssl to sql server this means that existing connection strings will not work if ssl is not enabled add ';encrypt=false' to the end of all custom connection strings this is done by default for the main activate connection string, but if you have other custom connection strings then they will need updating the default connection library has changed from system data sqlclient to microsoft data sqlclient this is the latest version of the connection library and is where microsoft are focusing all future development work it also contains the latest security and options for connecting to azure sql change any scripts 'using system data sqlclient' to 'using microsoft data sqlclient' provisioningsystem sqlconnection has been renamed to provisioningsystem getnewsqlconnection() this was done to make it explicit that the sqlconnect that is being returned is a new connection and that the caller is responsible for disposing and closing the connection this has caused connection leaks in the past where script writers did not do this replace provisioningsystem sqlconnection with provisioningsystem getnewsqlconnection() or replace any 'cmd= new sqlcommand()' with 'cmd = new activatesqlcommand()' and remove the sql and remove the 'cmd connection = xxx' line if you are connecting to a database other than the activate one you will still need the 'cmd connection = xxx' to set the connection string activate studio and agents also can connect via a sql proxy rather than directly to the database this allows a signal r websockets protocol that can pass firewalls with only https required therefore the base dbconnection is used rather than sqlconnection change any references from 'sqldatareader' to 'system data common dbdatareader' change sqlcommand cmd = new sqlcommand() to activatesqlcommand cmd = new activatesqlcommand()