This project is archived and is in readonly mode.

#1269 ✓resolved
Steve Purcell

Transactions broken with postgres-pr

Reported by Steve Purcell | October 25th, 2008 @ 11:28 AM | in 2.x

Unlike previous Rails releases, 2.2 RC1 is broken with postgres-pr, the pure-ruby PostgreSQL adapter:

Specifically, a simple #save results in the following:


 undefined method `transaction_status' for #<PGconn:0x32ec0cc>
  activerecord-2.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:527:in `transaction_active?'

Here's the offending line:


      # Check whether a transaction is active.
      def transaction_active?
        @connection.transaction_status != PQTRANS_IDLE
      end

I believe that JRuby users often use postgres-pr, and it's a widespread lightweight alternative to the libpq-based drivers.

Comments and changes to this ticket

  • Steve Purcell
  • Steve Purcell

    Steve Purcell October 28th, 2008 @ 01:25 PM

    • Assigned user set to “Pratik”

    Hey Pratik - I filed this issue that I'd mentioned in a comment on the Rails blog; you'd suggested I mail the Core list about it, but I figured this was also a good option. Can you maybe move the ticket to the 2.2 milestone for me please? Thanks!

  • Pratik

    Pratik October 28th, 2008 @ 01:27 PM

    • Assigned user changed from “Pratik” to “Tarmo Tänav”

    Tarmo would know better :)

  • Tarmo Tänav

    Tarmo Tänav October 28th, 2008 @ 02:18 PM

    looks like postgres-pr doesn't have full transaction_status implementation though it does seem to have some code that might give the ability to get access to transaction_status. But since postgres-pr hasn't been updated for over 3 years it's unlikely that someone is going to finish that support, not sure what to do here.

  • Steve Purcell

    Steve Purcell October 28th, 2008 @ 02:26 PM

    Agreed. It's a tricky issue. I know the postgres-pr author, so I'll mail him and see what he knows about retrieving the transaction status. Providing #transaction_status seems to be the best possible solution.

  • Steve Purcell

    Steve Purcell October 30th, 2008 @ 10:21 AM

    Michael Neumann rocks -- he's fixed postgres-pr to provide #transaction_status, and the patched version passes the ActiveRecord unit tests.

    Expect a 0.5 release of postgres-pr soon. In the meantime, this isn't a Rails issue any more, so feel free to close this ticket.

  • DHH

    DHH October 30th, 2008 @ 10:34 AM

    • State changed from “new” to “resolved”
  • bingbing

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages