Re: issue with pydo transactions in postgresql

Jacob Smullyan <[email protected]> Mon, 20 Jun 2005 07:31:29 -0400
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
On Mon, Jun 20, 2005 at 06:27:34PM +1000, Adam Ward wrote:
> 
> When an error occurs in postgreSQL during a transaction block any
> further commands executed will return an error. As seen by the
> following:

[snip]

> This results in a complete shutdown of any pydo objects using the same
> connection alias.
> 
> The problem is fixed upon issuing a .commit() on any PyDO class.

A rollback() is what you want to call upon error.  What you are
describing is just how transactions are supposed to work.  It isn't a
problem at all, I don't think, unless I'm missing something fairly
major.
 
> I have also had problems when the underlying connection to the database
> is lost. However I have been unable to recover from this.

> Is there a better solution, or do you have any suggestions?

There isn't a solution per se.  When the underlying connection is
lost, that is a hard error.  You can try reconnecting, but if the db
is down how is PyDO supposed to recover?  This class of error can be
addressed to some degree by the pool mechanism, but to a limited
extent.  I'm in a rush at the moment, but I'll try to remember to provide details later ....

js




-- 
Jacob Smullyan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCtqkRuqamFyFXXLIRAqe3AJ4xd64YKnmEZyEzTymNakUFpCGkOwCfR+fl
k9QX7zr7ZwirsWUwHBWrz6g=
=9NaZ
-----END PGP SIGNATURE-----