Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
f2f98abb
Kaydet (Commit)
f2f98abb
authored
Mar 11, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoided closing the database connection within a transaction.
Refs #9437.
üst
b746f8a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
operations.py
django/contrib/gis/db/backends/postgis/operations.py
+4
-12
__init__.py
django/db/backends/__init__.py
+3
-1
No files found.
django/contrib/gis/db/backends/postgis/operations.py
Dosyayı görüntüle @
f2f98abb
...
...
@@ -402,18 +402,10 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
"""
Helper routine for calling PostGIS functions and returning their result.
"""
cursor
=
self
.
connection
.
_cursor
()
try
:
try
:
cursor
.
execute
(
'SELECT
%
s()'
%
func
)
row
=
cursor
.
fetchone
()
except
:
# Responsibility of callers to perform error handling.
raise
finally
:
# Close out the connection. See #9437.
self
.
connection
.
close
()
return
row
[
0
]
# Close out the connection. See #9437.
with
self
.
connection
.
temporary_connection
()
as
cursor
:
cursor
.
execute
(
'SELECT
%
s()'
%
func
)
return
cursor
.
fetchone
()[
0
]
def
postgis_geos_version
(
self
):
"Returns the version of the GEOS library used with PostGIS."
...
...
django/db/backends/__init__.py
Dosyayı görüntüle @
f2f98abb
...
...
@@ -472,11 +472,13 @@ class BaseDatabaseWrapper(object):
Context manager that ensures that a connection is established, and
if it opened one, closes it to avoid leaving a dangling connection.
This is useful for operations outside of the request-response cycle.
Provides a cursor: with self.temporary_connection() as cursor: ...
"""
must_close
=
self
.
connection
is
None
cursor
=
self
.
cursor
()
try
:
yield
yield
cursor
finally
:
cursor
.
close
()
if
must_close
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment