Search Postgresql Archives

Re: Recovering from failed transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Brian!

I got a patch to fix this. Unfortunately, I'm having some problems with github at this moment and I couldn't push it to create a pull request.

Would you mind to patch a local copy of Npgsql code and give it a try?

Here is the patch:


diff --git a/Npgsql/Npgsql/NpgsqlConnector.cs b/Npgsql/Npgsql/NpgsqlConnector.cs
index eb7da15..5e090be 100644
--- a/Npgsql/Npgsql/NpgsqlConnector.cs
+++ b/Npgsql/Npgsql/NpgsqlConnector.cs
@@ -427,7 +427,7 @@ internal void ReleaseResources()

         internal void ReleaseWithDiscard()
         {
-            NpgsqlCommand.ExecuteBlind(this, NpgsqlQuery.DiscardAll, 60);
+            NpgsqlCommand.ExecuteBlind(this, NpgsqlQuery.DiscardAll);

             // The initial connection parameters will be restored via IsValid()
         }
@@ -828,7 +828,7 @@ internal void Open()

             initQueries = sbInitQueries.ToString();

-            NpgsqlCommand.ExecuteBlind(this, initQueries, 60);
+            NpgsqlCommand.ExecuteBlind(this, initQueries);

             // Make a shallow copy of the type mapping that the connector will
             // It is possible that the connector may add types to its privateY



Thanks in advance and sorry for this problem.



On Mon, Mar 10, 2014 at 6:49 PM, Brian Crowell <brian@xxxxxxxxxx> wrote:
On Mon, Mar 10, 2014 at 4:16 PM, Jeff Janes <jeff.janes@xxxxxxxxx> wrote:
> ...  Or maybe it is mangling the "ROLLBACK;" into some form
> the database doesn't recognize.  Look in the postgres log files to see what
> the events look like from PostgreSQL's perspective.

Well that's the clue I needed. I was misinterpreting Postgres's log
file; it was complaining about the "SET statement_timeout" statement
Npgsql was slipping ahead of my ROLLBACK. Apparently I need to do
transactions with Npgsql's transaction class.

--Brian


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux