[Dbi-interbase-devel] Apache::Session, Commit, and Questions
Status: Beta
Brought to you by:
edpratomo
From: Gary C. <be...@be...> - 2001-06-07 15:01:35
|
Howdy! I've been using DBD::InterBase for awhile now, and have had no trouble until recently. I don't know if what I've encountered is a bug, or if it is something broken in my own code... however, I'll explain it, and perhaps gain some insight from someone :) I've written/cobbled together in the last two days an Apache::Session::InterBase block of code, which works wonderfully so long as AutoCommit is turned on. As I've gone along, I've needed to begin using transactions... so, I set AutoCommit to off, and the following began to show up in my logs (the MD5 hashes are the session IDs generated by Apache::Session): [30714]:Thu Jun 7 10:26:10 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [b5b9c351cc45240082bae8d491f6534c - b5b9c351cc45240082bae8d491f6534c] (time: 0.0288040000000001) [30717]:Thu Jun 7 10:52:51 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [b5b9c351cc45240082bae8d491f6534c - b5b9c351cc45240082bae8d491f6534c] (time: 0.552508) [30723]:Thu Jun 7 10:52:55 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [b5b9c351cc45240082bae8d491f6534c - b5b9c351cc45240082bae8d491f6534c] (time: 0.760646) [30718]:Thu Jun 7 10:52:58 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [b5b9c351cc45240082bae8d491f6534c - b5b9c351cc45240082bae8d491f6534c] (time: 0.949615) [30717]:Thu Jun 7 10:52:59 2001:DBD::InterBase::st execute failed: Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements -Dynamic SQL Error -SQL error code = -901 -invalid transaction handle (expecting explicit transaction start) [30717]:Thu Jun 7 10:52:59 2001: [30717]:Thu Jun 7 10:52:59 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [061732a9bd6a1b8aa23fb5e1fd67f892 - 061732a9bd6a1b8aa23fb5e1fd67f892] (time: 0.029492) [30718]:Thu Jun 7 10:52:59 2001:DBD::InterBase::st execute failed: Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements -Dynamic SQL Error -SQL error code = -901 -invalid transaction handle (expecting explicit transaction start) [30718]:Thu Jun 7 10:52:59 2001: [30718]:Thu Jun 7 10:52:59 2001:Displayed GET / HTTP/1.1 (Splash) for 10.1.1.4 [eead34da9a8785ff8d20d63c68dfb7c3 - eead34da9a8785ff8d20d63c68dfb7c3] (time: 0.029887) And there it is... suddenly an error -901. I thought that it might be caused by commits happening only in the DESTROY method, so I added explicit calls to $dbh->commit but this didn't seem to solve the problem, either... here is a sample piece of the 'insert' method: sub insert { my $self = shift; my $session = shift; $self->connection($session); local $self->{dbh}->{RaiseError} = 1; if (!defined $self->{insert_sth}) { $self->{insert_sth} = $self->{dbh}->prepare_cached(qq{ INSERT INTO sessions (id, a_session) VALUES (?,?)}); } $self->{insert_sth}->bind_param(1, $session->{data}->{_session_id}); $self->{insert_sth}->bind_param(2, $session->{serialized}); $self->{insert_sth}->execute; $self->{dbh}->commit if ($self->{commit}); $self->{insert_sth}->finish; } The added commit is at the bottom. I've been beating my head against a wall on this. Once it's done, I'll be submitting the code to the Apache::Session folks... but I wanted to get it working first. Thanks for any suggestions or advice. Cheers, Gary ********* ***** ** Gary Coulbourne *************************.* Bear Hacktivist ****** *********** ** *******o ******* ********* **** ****`- Systems Administrator ******* ********* ***** http://www.bears.org ****** ********** **** be...@be... ## ***** ***** ## **** Animal Conservation/Preservation ### ***** ### **** #,,, ***,,, ##,,, **,,, |