]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- The post_exec() hook now gets invoked before autocommit fires.
authorJason Kirtland <jek@discorporate.us>
Tue, 23 Oct 2007 01:16:27 +0000 (01:16 +0000)
committerJason Kirtland <jek@discorporate.us>
Tue, 23 Oct 2007 01:16:27 +0000 (01:16 +0000)
lib/sqlalchemy/engine/base.py

index 656384ba657b6a8a120cbd2d695a5220ab846396..5f39756849f8f6586160a068b06352aa0292b137 100644 (file)
@@ -787,6 +787,7 @@ class Connection(Connectable):
         parameters = self.__distill_params(multiparams, params)
         context = self.__create_execution_context(statement=statement, parameters=parameters)
         self.__execute_raw(context)
+        self._autocommit(context)
         return context.result()
 
     def __distill_params(self, multiparams, params):
@@ -840,6 +841,7 @@ class Connection(Connectable):
         context.pre_execution()
         self.__execute_raw(context)
         context.post_execution()
+        self._autocommit(context)
         return context.result()
 
     def __create_execution_context(self, **kwargs):
@@ -850,8 +852,7 @@ class Connection(Connectable):
             self._cursor_executemany(context.cursor, context.statement, context.parameters, context=context)
         else:
             self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
-        self._autocommit(context)
-
+        
     def _cursor_execute(self, cursor, statement, parameters, context=None):
         if self.__engine._should_log_info:
             self.__engine.logger.info(statement)