Commits

Mike Bayer committed 9dd5d5a

dont call connection()/get_bind() all that here if we don't have to

  • Participants
  • Parent commits 4600fdd
  • Branches rel_0_7

Comments (0)

Files changed (1)

File lib/sqlalchemy/orm/persistence.py

         connection_callable = \
                 uowtransaction.session.connection_callable
     else:
-        connection = uowtransaction.transaction.connection(
-                                                    base_mapper)
+        connection = None
         connection_callable = None
 
     for state in _sort_states(states):
         if connection_callable:
             connection = connection_callable(base_mapper, state.obj())
+        elif not connection:
+            connection = uowtransaction.transaction.connection(
+                                                    base_mapper)
 
         mapper = _state_mapper(state)