[Zope-DB] Zope database connectivity
Maciej Wisniowski
maciej.wisniowski at coig.katowice.pl
Wed Sep 27 11:49:56 EDT 2006
>Not strictly speaking in ZODB:
>
> The "_v_" use for database connections is dangerous (and if you
> want buggy).
>
> It can lead to nasty, apparently non-deterministic effects.
> You may lose your database connection mid transaction
> and part of what you think is a transaction (i.e. atomical) can be lost.
>
> There are too ways to fix this problem: do not use "_v_" attributes
> to maintain the database connection or extend the ZODB to
> allow more control over the lifetime of "_v_" attributes.
>
Thanks again for explanations. Seems that I'll change my DA's
(DCOracle2 and ZCxOracleDA) to use connection pool like psycopg
does. After quick look at their (psycopg) solution I think it is really good
and solves (or may solve) few other issues too - like closing
all connections with 'Close connection' button (useless with
_v_ implementation). Implementing reconnect of broken connection
i.e. when database was restarted shouldn't be too difficult too.
--
Maciej Wisniowski
More information about the Zope-DB
mailing list