title: Instance <xxx> has been deleted after commit(), but when and why?
body: <p>Here's a really simple piece of code. After adding the "poll" instance to the DB and committing, I cannot later read it. SQLAlchemy fails with the error:</p>
  
  <pre><code>Instance '&lt;PollStat at 0x7f9372ea72b0&gt;' has been deleted, or its row is otherwise not present.
  </code></pre>
  
  <p>Weirdly, this does not happen if I replace the ts_start/ts_run primary key by an integer autoincrement one. Is it possible that DateTime columns are not suitable as primary key?</p>
  
  <pre><code>db = Session()
  poll = models.PollStat(
      ts_start=datetime.datetime.now(),
      ts_run=ts_run,
      polled_tools=0)
  db.add(poll)
  db.commit()              # I want to commit here in case something fails later
  print(poll.polled_tools) # this fails
  </code></pre>
  
  <p>PollStat in module models.py:</p>
  
  <pre><code>class PollStat(Base):
      __tablename__ = 'poll_stat'
      ts_run        = Column(Integer, primary_key=True)
      ts_start      = Column(DateTime, primary_key=True)
      elapsed_ms    = Column(Integer, default=None)
      polled_tools  = Column(Integer, default=0)
  </code></pre>
  
  <p>But if I do this:</p>
  
  <pre><code>class PollStat(Base):
      __tablename__ = 'poll_stat'
      id            = Column(Integer, primary_key=True)
      ts_run        = Column(Integer)
      ts_start      = Column(DateTime)
      elapsed_ms    = Column(Integer, default=None)
      polled_tools  = Column(Integer, default=0)
  </code></pre>
  
  <p>it works. Why?</p>