1. 18 6月, 2015 5 次提交
  2. 17 6月, 2015 1 次提交
  3. 16 6月, 2015 1 次提交
    • A
      daklib/ls.py: manage our own database session · 3eeb7044
      Ansgar Burchardt 提交于
      session_wrapper gets confused by generators: let "f" be a generator
      making use of a database session:
      
          def wrapped_f():
            session = DBConn().session()
            try:
              return f(session)
            finally:
              session.close()
      
          for item in wrapped_f():
            do_something(item)
      
      will leak database sessions as the implementation of "f" will only be
      invoked from the for-loop. However at this time the "finally" block
      closing the session has already run. SQLAlchemy will helpfully reopen
      the session, but it will not be closed in the end.
      3eeb7044
  4. 14 6月, 2015 4 次提交
  5. 13 6月, 2015 5 次提交
  6. 12 6月, 2015 13 次提交
  7. 11 6月, 2015 11 次提交