1 |
# Copyright (C) 2003, 2004 by Intevation GmbH |
# Copyright (C) 2003, 2004, 2005 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Martin Mueller <[email protected]> |
# Martin Mueller <[email protected]> |
4 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
107 |
except psycopg.OperationalError, val: |
except psycopg.OperationalError, val: |
108 |
raise ConnectionError(str(val)) |
raise ConnectionError(str(val)) |
109 |
|
|
110 |
|
# Use autocommit mode. For simple reading of the database it's |
111 |
|
# sufficient and we don't have to care much about error |
112 |
|
# handling. Without autocommit, an errors during a cursor's |
113 |
|
# execute method requires a rollback on the connection, |
114 |
|
# otherwise later queries with the same or other cursors sharing |
115 |
|
# the same connection will lead to further errors ("ERROR: |
116 |
|
# current transaction is aborted, commands ignored until end of |
117 |
|
# transaction block") |
118 |
|
self.connection.autocommit() |
119 |
|
|
120 |
# determine the OID for the geometry type. This is PostGIS |
# determine the OID for the geometry type. This is PostGIS |
121 |
# specific. |
# specific. |
122 |
cursor = self.connection.cursor() |
cursor = self.connection.cursor() |