# commit session, flushes whatever is remaining
sess.commit()
+Autoflush is particularly handy when using "dynamic" mapper relations, so that changes to the underlying collection are immediately available via its query interface.
+
### Expunge / Clear
Expunge removes an object from the Session, sending persistent instances to the detached state, and pending instances to the transient state:
However note that the `clear()` method does not reset any transactional state or connection resources; therefore what you usually want to call instead of `clear()` is `close()`.
-note that objects in collections can be re-saved again
-
### Closing
The `close()` method issues a `clear()`, and releases any transactional/connection resources. When connections are returned to the connection pool, whatever transactional state exists is rolled back.
Horizontal partitioning partitions the rows of a single table (or a set of tables) across multiple databases.
-See the "sharding" example in [attribute_shard.py](http://www.sqlalchemy.org/trac/browser/trunk/examples/sharding/attribute_shard.py)
+See the "sharding" example in [attribute_shard.py](http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/examples/sharding/attribute_shard.py)