Re: Transactions errors with DBD-Sybase-1.05

Michael Peppler <[email protected]>
Newsgroups gmane.comp.db.tds.freetds,gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
On Tue, 2005-03-22 at 20:04, David Barnwell wrote:
> Hi,
> 
> I've hit some problems executing transactions and rollbacks with
> DBD-Sybase-1.05 and FreeTDS 0.63RC10. My client system runs Red Hat
> Enterprise Linux 3 and perl-5.8.0-88.4, and the server is SQL Server 2000.
> 
> The code I use is based on the example in DBI.pm. The central part is:
> 
>    $dbh->{AutoCommit} = 0;
>    $dbh->{RaiseError} = 1;
> 
>    eval {
>       my $sth = $dbh->prepare($sql);
>       $sth->execute;
>       $sth->finish;

Why do you call finish() here?

>       $dbh->commit;
>    };
>    if ($@) {
>       eval { $dbh->rollback };
>    }
> 
> The SQL statement executes a stored procedure that updates a table. This
> works fine with DBD-Sybase-1.04 and FreeTDS 0.63RC10. The procedure is
> executed OK and the table is updated.
> 
> However, the program fails with DBD-Sybase-1.05. The SQL is executed and
> the table is updated, but the transaction fails with the following error
> message:
> 
>    Attempt to initiate a new SQL Server operation with results pending

Please post (or send me) a trace with DBI->trace(5).

Michael
-- 
Michael Peppler  -  [email protected]  -  http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.