mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	Fixed #3024 -- Fixed database commit() and rollback() behaviour so it works
consistently if you execute them before Django has made a database connection. Thanks Bastian Kleineidam. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		
							
								
								
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							| @@ -112,6 +112,7 @@ answer newbie questions, and generally made Django that much better: | |||||||
|     Garth Kidd <http://www.deadlybloodyserious.com/> |     Garth Kidd <http://www.deadlybloodyserious.com/> | ||||||
|     kilian <kilian.cavalotti@lip6.fr> |     kilian <kilian.cavalotti@lip6.fr> | ||||||
|     Sune Kirkeby <http://ibofobi.dk/> |     Sune Kirkeby <http://ibofobi.dk/> | ||||||
|  |     Bastian Kleineidam <calvin@debian.org> | ||||||
|     Cameron Knight (ckknight) |     Cameron Knight (ckknight) | ||||||
|     Meir Kriheli <http://mksoft.co.il/> |     Meir Kriheli <http://mksoft.co.il/> | ||||||
|     Bruce Kroeze <http://coderseye.com/> |     Bruce Kroeze <http://coderseye.com/> | ||||||
|   | |||||||
| @@ -76,10 +76,11 @@ class DatabaseWrapper(local): | |||||||
|         return cursor |         return cursor | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         return self.connection.commit() |         if self.connection is not None: | ||||||
|  |             return self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             return self.connection.rollback() |             return self.connection.rollback() | ||||||
|  |  | ||||||
|     def close(self): |     def close(self): | ||||||
|   | |||||||
| @@ -108,10 +108,11 @@ class DatabaseWrapper(local): | |||||||
|         return cursor |         return cursor | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         self.connection.commit() |         if self.connection is not None: | ||||||
|  |             self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             try: |             try: | ||||||
|                 self.connection.rollback() |                 self.connection.rollback() | ||||||
|             except Database.NotSupportedError: |             except Database.NotSupportedError: | ||||||
|   | |||||||
| @@ -43,10 +43,11 @@ class DatabaseWrapper(local): | |||||||
|         return FormatStylePlaceholderCursor(self.connection) |         return FormatStylePlaceholderCursor(self.connection) | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         self.connection.commit() |         if self.connection is not None: | ||||||
|  |             self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             try: |             try: | ||||||
|                 self.connection.rollback() |                 self.connection.rollback() | ||||||
|             except Database.NotSupportedError: |             except Database.NotSupportedError: | ||||||
|   | |||||||
| @@ -92,10 +92,11 @@ class DatabaseWrapper(local): | |||||||
|         return cursor |         return cursor | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         return self.connection.commit() |         if self.connection is not None: | ||||||
|  |             return self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             return self.connection.rollback() |             return self.connection.rollback() | ||||||
|  |  | ||||||
|     def close(self): |     def close(self): | ||||||
|   | |||||||
| @@ -60,10 +60,11 @@ class DatabaseWrapper(local): | |||||||
|         return cursor |         return cursor | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         return self.connection.commit() |         if self.connection is not None: | ||||||
|  |             return self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             return self.connection.rollback() |             return self.connection.rollback() | ||||||
|  |  | ||||||
|     def close(self): |     def close(self): | ||||||
|   | |||||||
| @@ -67,10 +67,11 @@ class DatabaseWrapper(local): | |||||||
|             return cursor |             return cursor | ||||||
|  |  | ||||||
|     def _commit(self): |     def _commit(self): | ||||||
|         self.connection.commit() |         if self.connection is not None: | ||||||
|  |             self.connection.commit() | ||||||
|  |  | ||||||
|     def _rollback(self): |     def _rollback(self): | ||||||
|         if self.connection: |         if self.connection is not None: | ||||||
|             self.connection.rollback() |             self.connection.rollback() | ||||||
|  |  | ||||||
|     def close(self): |     def close(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user