Re: Recovering from failed transaction

From: "Francisco Figueiredo Jr(dot)" <francisco(at)npgsql(dot)org>
To: Brian Crowell <brian(at)fluggo(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Recovering from failed transaction
Date: 2014-03-11 22:19:14
Message-ID: CACUQdMaNv1ryiXVVJRHh6u57PQth6EF59tkn9+Lfi0xNrdmCbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)fluggo(dot)com> wrote:

> On Mon, Mar 10, 2014 at 4:16 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> 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(at)postgresql(dot)org)
> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2014-03-11 23:03:42 When does pg_archivecleanup work?
Previous Message John R Pierce 2014-03-11 20:06:25 Re: Increase in max_connections