diff options
| author | Ants Aasma <ants.aasma@gmail.com> | 2007-10-08 15:25:51 +0000 |
|---|---|---|
| committer | Ants Aasma <ants.aasma@gmail.com> | 2007-10-08 15:25:51 +0000 |
| commit | 47d3f45d583ce82e5c6f967e580716cbb8e1791b (patch) | |
| tree | e36a193bd4e4f6ebe2b4f7b6ef3b2bdf2799de01 /lib/sqlalchemy/databases/postgres.py | |
| parent | 0010807253c34bd5696be4f6e216138d9f509613 (diff) | |
| download | sqlalchemy-47d3f45d583ce82e5c6f967e580716cbb8e1791b.tar.gz | |
- fix multiple consequent two phase transactions not working with postgres. For some reason implicit transactions are not enough. [ticket:810]
- add an option to scoped session mapper extension to not automatically save new objects to session.
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
| -rw-r--r-- | lib/sqlalchemy/databases/postgres.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 74b9e6f43..345893524 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -306,6 +306,9 @@ class PGDialect(default.DefaultDialect): return sqltypes.adapt_type(typeobj, colspecs) def do_begin_twophase(self, connection, xid): + # Two phase transactions seem to require that the transaction is explicitly started. + # The implicit transactions that usually work aren't enough. + connection.execute(sql.text("BEGIN")) self.do_begin(connection.connection) def do_prepare_twophase(self, connection, xid): |
