From 97e8d29a4be9aa387ba39d5b563681cbf293a75c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 06:43:45 -0500 Subject: [PATCH 01/11] Bump AkkaVersion from 1.3.14 to 1.3.15 (#124) Bumps `AkkaVersion` from 1.3.14 to 1.3.15. Updates `Akka.Persistence.Sql.Common` from 1.3.14 to 1.3.15 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/1.3.15/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/1.3.14...1.3.15) Updates `Akka.Persistence.Sql.TestKit` from 1.3.14 to 1.3.15 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/1.3.15/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/1.3.14...1.3.15) Signed-off-by: dependabot-preview[bot] --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index a781ac5..abc07d4 100644 --- a/src/common.props +++ b/src/common.props @@ -12,7 +12,7 @@ 2.4.1 - 1.3.14 + 1.3.15 15.9.0 netcoreapp2.1 net461 From cccd19b6bc6b24e809892c8d9a7e9b6fb681deb9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 07:08:03 -0500 Subject: [PATCH 02/11] Bump Microsoft.NET.Test.Sdk from 15.9.0 to 16.3.0 (#125) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 15.9.0 to 16.3.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v15.9.0...v16.3) Signed-off-by: dependabot-preview[bot] --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index abc07d4..1254012 100644 --- a/src/common.props +++ b/src/common.props @@ -13,7 +13,7 @@ 2.4.1 1.3.15 - 15.9.0 + 16.3.0 netcoreapp2.1 net461 netstandard1.6 From c30dde0ee6989f0b9d990bb0b80b07e0f8c3fe3e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 08:11:08 -0500 Subject: [PATCH 03/11] Bump System.Data.SqlClient from 4.3.0 to 4.7.0 (#126) Bumps [System.Data.SqlClient](https://github.com/dotnet/corefx) from 4.3.0 to 4.7.0. - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) Signed-off-by: dependabot-preview[bot] --- .../Akka.Persistence.SqlServer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj b/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj index c9d9a14..217c189 100644 --- a/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj +++ b/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj @@ -23,7 +23,7 @@ - 4.3.0 + 4.7.0 \ No newline at end of file From 377442827bc25dfa33302f1c151a4a4fdb2a2f5e Mon Sep 17 00:00:00 2001 From: Zetanova Date: Sat, 5 Oct 2019 16:53:37 +0200 Subject: [PATCH 04/11] Fix of migration script (#66) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f3ce572..1d22896 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ ALTER TABLE {your_snapshot_table_name} ADD COLUMN SerializerId INTEGER NULL ```sql ALTER TABLE {your_journal_table_name} DROP CONSTRAINT PK_{your_journal_table_name}; +ALTER TABLE {your_journal_table_name} ADD Ordering BIGINT IDENTITY(1,1) PRIMARY KEY NOT NULL; ALTER TABLE {your_journal_table_name} ADD Ordering BIGINT IDENTITY(1,1) NOT NULL; ALTER TABLE {your_journal_table_name} ADD CONSTRAINT PK_EventJournal PRIMARY KEY (Ordering); ALTER TABLE {your_journal_table_name} ADD CONSTRAINT QU_{your_journal_table_name} UNIQUE (PersistenceID, SequenceNr); @@ -192,9 +193,11 @@ RETURN CONVERT(bigint, END; ALTER TABLE {your_journal_table_name} ADD Timestamp_tmp BIGINT NULL; UPDATE {your_journal_table_name} SET Timestamp_tmp = dbo.Ticks(Timestamp); +DROP INDEX [IX_EventJournal_Timestamp] ON {your_journal_table_name}; ALTER TABLE {your_journal_table_name} DROP COLUMN Timestamp; ALTER TABLE {your_journal_table_name} ALTER COLUMN Timestamp_tmp BIGINT NOT NULL; EXEC sp_RENAME '{your_journal_table_name}.Timestamp_tmp' , 'Timestamp', 'COLUMN'; +CREATE NONCLUSTERED INDEX [IX_EventJournal_Timestamp] ON {your_journal_table_name}([Timestamp] ASC); ALTER TABLE {your_journal_table_name} ADD Tags NVARCHAR(100) NULL; ``` From e288bbe0d67ea099d0f84527d42f18d49fd401cb Mon Sep 17 00:00:00 2001 From: Irvin Dominin Date: Sat, 12 Oct 2019 17:50:08 +0200 Subject: [PATCH 05/11] Fixed tab instead of space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d22896..eae4c04 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ CREATE TABLE {your_journal_table_name} ( Payload VARBINARY(MAX) NOT NULL, Tags NVARCHAR(100) NULL, SerializerId INTEGER NULL - CONSTRAINT PK_{your_journal_table_name} PRIMARY KEY (Ordering), + CONSTRAINT PK_{your_journal_table_name} PRIMARY KEY (Ordering), CONSTRAINT QU_{your_journal_table_name} UNIQUE (PersistenceID, SequenceNr) ); From 4046d15c865d5ca846eae5c5e5f7eaa5824e1ac9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2019 20:43:59 +0000 Subject: [PATCH 06/11] Bump AkkaVersion from 1.3.15 to 1.3.16 Bumps `AkkaVersion` from 1.3.15 to 1.3.16. Updates `Akka.Persistence.Sql.Common` from 1.3.15 to 1.3.16 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/1.3.16/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/1.3.15...1.3.16) Updates `Akka.Persistence.Sql.TestKit` from 1.3.15 to 1.3.16 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/1.3.16/RELEASE_NOTES.md) - [Commits](https://github.com/akkadotnet/akka.net/compare/1.3.15...1.3.16) Signed-off-by: dependabot-preview[bot] --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index 1254012..2399316 100644 --- a/src/common.props +++ b/src/common.props @@ -12,7 +12,7 @@ 2.4.1 - 1.3.15 + 1.3.16 16.3.0 netcoreapp2.1 net461 From 39003a030369cef8dbc1b7cffb1f9215489fec98 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2019 17:05:43 +0000 Subject: [PATCH 07/11] Bump Microsoft.NET.Test.Sdk from 16.3.0 to 16.4.0 (#128) --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index 2399316..c615930 100644 --- a/src/common.props +++ b/src/common.props @@ -13,7 +13,7 @@ 2.4.1 1.3.16 - 16.3.0 + 16.4.0 netcoreapp2.1 net461 netstandard1.6 From ccc1696c0149107edf3a16fb31f6ea62baf60af0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2019 21:17:45 +0000 Subject: [PATCH 08/11] Bump AkkaVersion from 1.3.16 to 1.3.17 (#131) --- src/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.props b/src/common.props index c615930..cd10fee 100644 --- a/src/common.props +++ b/src/common.props @@ -12,7 +12,7 @@ 2.4.1 - 1.3.16 + 1.3.17 16.4.0 netcoreapp2.1 net461 From cb05d970bf2fd4d643b76b85e9e0b3973ea570a9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2019 21:37:44 +0000 Subject: [PATCH 09/11] Bump System.Data.SqlClient from 4.7.0 to 4.8.0 (#130) --- .../Akka.Persistence.SqlServer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj b/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj index 217c189..000fdde 100644 --- a/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj +++ b/src/Akka.Persistence.SqlServer/Akka.Persistence.SqlServer.csproj @@ -23,7 +23,7 @@ - 4.7.0 + 4.8.0 \ No newline at end of file From 5e4f6170a7bf20ff6edab368f1a4bf7a9d5d4000 Mon Sep 17 00:00:00 2001 From: Jonathan Nagy Date: Tue, 21 Jan 2020 07:12:29 +1100 Subject: [PATCH 10/11] constrain parameters to their field size (#132) --- .../Journal/BatchingSqlServerJournal.cs | 4 +++- .../Journal/SqlServerQueryExecutor.cs | 4 +++- .../Snapshot/SqlServerQueryExecutor.cs | 22 +++++++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/Akka.Persistence.SqlServer/Journal/BatchingSqlServerJournal.cs b/src/Akka.Persistence.SqlServer/Journal/BatchingSqlServerJournal.cs index d23838a..d6680eb 100644 --- a/src/Akka.Persistence.SqlServer/Journal/BatchingSqlServerJournal.cs +++ b/src/Akka.Persistence.SqlServer/Journal/BatchingSqlServerJournal.cs @@ -53,6 +53,8 @@ public BatchingSqlServerJournal(Config config) : this(new BatchingSqlServerJourn var c = Setup.NamingConventions; ByTagSql = ByTagSql = $@" + DECLARE @Tag_sized NVARCHAR(100); + SET @Tag_sized = @Tag; SELECT TOP (@Take) e.{c.PersistenceIdColumnName} as PersistenceId, e.{c.SequenceNrColumnName} as SequenceNr, @@ -63,7 +65,7 @@ SELECT TOP (@Take) e.{c.SerializerIdColumnName} as SerializerId, e.{c.OrderingColumnName} as Ordering FROM {c.FullJournalTableName} e - WHERE e.{c.OrderingColumnName} > @Ordering AND e.{c.TagsColumnName} LIKE @Tag + WHERE e.{c.OrderingColumnName} > @Ordering AND e.{c.TagsColumnName} LIKE @Tag_sized ORDER BY {c.OrderingColumnName} ASC "; } diff --git a/src/Akka.Persistence.SqlServer/Journal/SqlServerQueryExecutor.cs b/src/Akka.Persistence.SqlServer/Journal/SqlServerQueryExecutor.cs index e639e3a..c2902c2 100644 --- a/src/Akka.Persistence.SqlServer/Journal/SqlServerQueryExecutor.cs +++ b/src/Akka.Persistence.SqlServer/Journal/SqlServerQueryExecutor.cs @@ -17,6 +17,8 @@ public SqlServerQueryExecutor(QueryConfiguration configuration, Akka.Serializati : base(configuration, serialization, timestampProvider) { ByTagSql = $@" + DECLARE @Tag_sized NVARCHAR(100); + SET @Tag_sized = @Tag; SELECT TOP (@Take) e.{Configuration.PersistenceIdColumnName} as PersistenceId, e.{Configuration.SequenceNrColumnName} as SequenceNr, @@ -27,7 +29,7 @@ SELECT TOP (@Take) e.{Configuration.SerializerIdColumnName} as SerializerId, e.{Configuration.OrderingColumnName} as Ordering FROM {Configuration.FullJournalTableName} e - WHERE e.{Configuration.OrderingColumnName} > @Ordering AND e.{Configuration.TagsColumnName} LIKE @Tag + WHERE e.{Configuration.OrderingColumnName} > @Ordering AND e.{Configuration.TagsColumnName} LIKE @Tag_sized ORDER BY {Configuration.OrderingColumnName} ASC "; CreateEventsJournalSql = $@" diff --git a/src/Akka.Persistence.SqlServer/Snapshot/SqlServerQueryExecutor.cs b/src/Akka.Persistence.SqlServer/Snapshot/SqlServerQueryExecutor.cs index 9ba2ab0..a7f413f 100644 --- a/src/Akka.Persistence.SqlServer/Snapshot/SqlServerQueryExecutor.cs +++ b/src/Akka.Persistence.SqlServer/Snapshot/SqlServerQueryExecutor.cs @@ -41,21 +41,27 @@ CREATE INDEX IX_{configuration.SnapshotTableName}_{configuration.TimestampColumn "; InsertSnapshotSql = $@" + DECLARE @Manifest_sized NVARCHAR(500); + DECLARE @Payload_sized VARBINARY(MAX); + DECLARE @PersistenceId_sized NVARCHAR(255); + SET @Manifest_sized = @Manifest; + SET @Payload_sized = @Payload; + SET @PersistenceId_sized = @PersistenceId; IF ( SELECT COUNT(*) FROM {configuration.FullSnapshotTableName} WHERE {configuration.SequenceNrColumnName} = @SequenceNr - AND {configuration.PersistenceIdColumnName} = @PersistenceId) > 0 + AND {configuration.PersistenceIdColumnName} = @PersistenceId_sized) > 0 UPDATE {configuration.FullSnapshotTableName} SET - {configuration.PersistenceIdColumnName} = @PersistenceId, + {configuration.PersistenceIdColumnName} = @PersistenceId_sized, {configuration.SequenceNrColumnName} = @SequenceNr, {configuration.TimestampColumnName} = @Timestamp, - {configuration.ManifestColumnName} = @Manifest, - {configuration.PayloadColumnName} = @Payload, + {configuration.ManifestColumnName} = @Manifest_sized, + {configuration.PayloadColumnName} = @Payload_sized, {configuration.SerializerIdColumnName} = @SerializerId WHERE {configuration.SequenceNrColumnName} = @SequenceNr - AND {configuration.PersistenceIdColumnName} = @PersistenceId ELSE + AND {configuration.PersistenceIdColumnName} = @PersistenceId_sized ELSE INSERT INTO {configuration.FullSnapshotTableName} ( {configuration.PersistenceIdColumnName}, {configuration.SequenceNrColumnName}, @@ -63,9 +69,11 @@ SELECT COUNT(*) {configuration.ManifestColumnName}, {configuration.PayloadColumnName}, {configuration.SerializerIdColumnName}) - VALUES (@PersistenceId, @SequenceNr, @Timestamp, @Manifest, @Payload, @SerializerId);"; + VALUES (@PersistenceId_sized, @SequenceNr, @Timestamp, @Manifest_sized, @Payload_sized, @SerializerId);"; SelectSnapshotSql = $@" + DECLARE @PersistenceId_sized NVARCHAR(255); + SET @PersistenceId_sized = @PersistenceId; SELECT TOP 1 {Configuration.PersistenceIdColumnName}, {Configuration.SequenceNrColumnName}, {Configuration.TimestampColumnName}, @@ -73,7 +81,7 @@ SELECT COUNT(*) {Configuration.PayloadColumnName}, {Configuration.SerializerIdColumnName} FROM {Configuration.FullSnapshotTableName} - WHERE {Configuration.PersistenceIdColumnName} = @PersistenceId + WHERE {Configuration.PersistenceIdColumnName} = @PersistenceId_sized AND {Configuration.SequenceNrColumnName} <= @SequenceNr AND {Configuration.TimestampColumnName} <= @Timestamp ORDER BY {Configuration.SequenceNrColumnName} DESC"; From a3ae2413e1e34d334a215e9cd625192a178857b5 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 20 Jan 2020 14:38:43 -0600 Subject: [PATCH 11/11] added v1.3.17 release notes (#133) --- RELEASE_NOTES.md | 6 ++++++ src/common.props | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8589d36..f939b18 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,9 @@ +#### 1.3.17 January 20 2020 #### +* Upgrades to Akka.Persistence v1.3.17. +* Upgrades to latest SqlClient. +* [Resolved: Generated SQL creates a large number of cached query plans in SQL Server](https://github.com/akkadotnet/akka.net/issues/4141) + + #### 1.3.14 July 30 2019 #### * Upgrades to Akka.Persistence v1.3.14 - resolves major issues with Akka.Cluster.Sharding serialization. * [BatchingSqlJournal now preserves Sender in PersistCallback](https://github.com/akkadotnet/akka.net/pull/3779) diff --git a/src/common.props b/src/common.props index cd10fee..ea8db88 100644 --- a/src/common.props +++ b/src/common.props @@ -2,12 +2,13 @@ Copyright © 2013-2019 Akka.NET Team Akka.NET Team - 1.3.14 + 1.3.17 http://getakka.net/images/akkalogo.png https://github.com/akkadotnet/Akka.Persistence.SqlServer https://github.com/akkadotnet/Akka.Persistence.SqlServer/blob/master/LICENSE - Upgrades to Akka.Persistence v1.3.14 - resolves major issues with Akka.Cluster.Sharding serialization. -[BatchingSqlJournal now preserves Sender in PersistCallback](https://github.com/akkadotnet/akka.net/pull/3779) + Upgrades to Akka.Persistence v1.3.17. +Upgrades to latest SqlClient. +[Resolved: Generated SQL creates a large number of cached query plans in SQL Server](https://github.com/akkadotnet/akka.net/issues/4141) $(NoWarn);CS1591