title: In SQLAlchemy, what's the difference between DBSession and DBSession()?
body: <pre><code>DBSession = scoped_session(sessionmaker(bind=engine)
  
  #1
  DBSession.add(someobject)
  DBsession.commit()
  
  #2
  session = DBSession()
  session.add(someobject)
  session.commit()
  </code></pre>
  
  <p>What's the difference between <strong>#1</strong> and <strong>#2</strong>?</p>
  
  <p>I use <strong>#1</strong> in my Pyramid app and there're a lot of exceptions of 'MySQL has gone away' </p>