On Monday, November 18, 2002, at 07:23  AM, Michael Alan Dorman wrote:

Perhaps I misunderstand how things are happening in the low-level
protocol, but if a connection to postgres is in autocommit mode by
default, which I understand to be the case, then all you need to do is
have the begin_work and commit and rollback commands complain if
AutoCommit is 1, and everything else complain if AutoCommit is 0 and
you're not in a transaction.
Yes, but one needs to be able to tell if a transaction is currently in progress or not. Right now, DBD::Pg assumes that if AutoCommit is 0, then a transaction is in progress. I don't think that's the best approach.

You've already got the AutoCommit boolean, so you would only need one
more, say, InTransaction, to recognize the AutoCommit 0/no begin_work
situation.
Right. I think I can use the init_commit flag in DBD::Pg for that purpose, since I can't really tell that it's used for much else at the moment.

If I have misunderstood and the situation is not this obvious, then I
at least agree with Tom here---issuing begin before the first command
in a new transaction can bite you, and I have, in fact, been bitten by
exactly this when using DBD::Pg with Apache::DBI.
Right, all the more reason to change the behavior.

Thanks Michael.

Regards,

David

--
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]

Reply via email to