Skip Menu |
 

This queue is for tickets about the Workflow CPAN distribution.

Report information
The Basics
Id: 15622
Status: resolved
Priority: 0/
Queue: Workflow

People
Owner: Nobody in particular
Requestors: jonasbn [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.15
Fixed in: 0.16

Attachments


Subject: Getting Workflow to work with PostgreSQL
Download (untitled) / with headers
text/plain 191b
I finally could get started on a project using your Workflow, it took some tweaks to get it to work with PostgreSQL though. I have included our patch, which get things going with PostgreSQL.
Download SequenceId.pm.patch
text/x-diff 1.5k
Index: SequenceId.pm =================================================================== RCS file: /cvs/patches/Workflow-0.15/lib/Workflow/Persister/DBI/SequenceId.pm,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 SequenceId.pm --- SequenceId.pm 8 Nov 2005 11:50:17 -0000 1.1.1.1 +++ SequenceId.pm 8 Nov 2005 12:04:58 -0000 @@ -1,23 +1,34 @@ package Workflow::Persister::DBI::SequenceId; -# $Id: SequenceId.pm,v 1.1.1.1 2005/11/08 11:50:17 jonasbn Exp $ +# $Id: SequenceId.pm,v 1.3 2004/03/08 04:56:09 cwinters Exp $ use strict; use base qw( Class::Accessor ); +use Log::Log4perl qw( get_logger ); +use DBI; -$Workflow::Persister::DBI::SequenceId::VERSION = sprintf("%d.%02d", q$Revision: 1.1.1.1 $ =~ /(\d+)\.(\d+)/); +$Workflow::Persister::DBI::SequenceId::VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); -my @FIELDS = qw( sequence_name sequence_select ); +my @FIELDS = qw( sequence_name sequence_select handle); __PACKAGE__->mk_accessors( @FIELDS ); +my ( $log ); sub pre_fetch_id { my ( $self, $dbh ) = @_; - my $full_select = sprintf( $self->sequence_select, $self->sequence_name ); my ( $sth ); + bless($self); + my $full_select = sprintf( $self->sequence_select, $self->sequence_name ); + $log ||= get_logger(); + $log->debug( "full_select = $full_select"); + $dbh = $self->handle; eval { $sth = $dbh->prepare( $full_select ); $sth->execute; }; + if ( $@ ) { + die "$@"; + } + my $row = $sth->fetchrow_arrayref; $sth->finish; return $row->[0];


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.