Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Transactions broken with postgres-pr

#1269

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.

Reported by Steve Purcell · October 25th, 2008 @ 11:28 AM

State: resolved
Milestone: 2.x
Assigned to: Tarmo Tänav Tarmo Tänav
Importance: none

Activity

  1. Steve Purcell
  2. Steve Purcell
    Steve Purcell
    • 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!

    October 28th, 2008 @ 01:25 PM

  3. Pratik
    Pratik
    • Assigned user changed from Pratik to Tarmo Tänav

    Tarmo would know better :)

    October 28th, 2008 @ 01:27 PM

  4. Tarmo Tänav
    Tarmo Tänav

    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.

    October 28th, 2008 @ 02:18 PM

  5. Steve Purcell
    Steve Purcell

    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.

    October 28th, 2008 @ 02:26 PM

  6. Steve Purcell
    Steve Purcell

    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.

    October 30th, 2008 @ 10:21 AM

  7. DHH
    DHH
    • State changed from new to resolved

    October 30th, 2008 @ 10:34 AM

  8. bingbing