title: Expunge object from SQLAlchemy session
body: <p>I want to pass an instance of a mapped class to a non-SQLAlchemy aware method (in another process) and only need the values of my attributes. The problem is, that an <code>UnboundExecutionError</code> occurs, every time the method wants to read an attribute value. I do understand, why this happens, but I would like to have a solution for this problem.</p>
  
  <p>I only need the values of my defined attributes (<em>id</em>, <em>name</em> and <em>dirty</em> in the example) and do not need the SQLAlchemy overhead in the destination method.</p>
  
  <p><strong>Example class:</strong></p>
  
  <pre><code>Base = declarative_base()
  class Record(Base):
      __tablename__ = 'records'
      _id = Column('id', Integer, primary_key=True)
      _name = Column('name', String(50))
      _dirty = Column('dirty', Boolean, index=True)
  
      @synonym_for('_id')
      @property
      def id(self):
          return self._id
  
      @property
      def name(self):
          return self._name
  
      @name.setter
      def name(self, value):
          self._name = value
          self._dirty = True
  
      name = synonym('_name', descriptor=name)
  
      @synonym_for('_dirty')
      @property
      def dirty(self):
          return self._dirty
  </code></pre>
  
  <p><strong>Example call:</strong></p>
  
  <pre><code>...
  def do_it(self):
      records = self.query.filter(Record.dirty == True)
      for record in records:
          pass_to_other_process(record)
  </code></pre>
  
  <p>I've tried using <code>session.expunge()</code> and <code>copy.copy()</code>, but without success.</p>