Commit 2504c7af authored by Savorboard's avatar Savorboard

Fix the connection release bug when occurred an exception.

parent dde9088b
...@@ -171,6 +171,7 @@ SELECT * FROM `{_prefix}.received` WHERE Id=LAST_INSERT_ID();"; ...@@ -171,6 +171,7 @@ SELECT * FROM `{_prefix}.received` WHERE Id=LAST_INSERT_ID();";
catch (MySqlException) catch (MySqlException)
{ {
transaction.Dispose(); transaction.Dispose();
connection.Dispose();
throw; throw;
} }
......
...@@ -146,6 +146,7 @@ namespace DotNetCore.CAP.PostgreSql ...@@ -146,6 +146,7 @@ namespace DotNetCore.CAP.PostgreSql
catch (NpgsqlException) catch (NpgsqlException)
{ {
transaction.Dispose(); transaction.Dispose();
connection.Dispose();
throw; throw;
} }
......
...@@ -153,6 +153,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);"; ...@@ -153,6 +153,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
catch (SqlException) catch (SqlException)
{ {
transaction.Dispose(); transaction.Dispose();
connection.Dispose();
throw; throw;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment