== Transactions ==

All write operations to the database need to be performed from within transactions.
This ensures that your database never ends up in an inconsistent state.

See <<transactions>> for details on how Neo4j handles transactions.

We use the python +with+ statement to define a transaction context. 
If you are using an older version of Python, you may have to import the +with+ statement:

[source, python]
----
from __future__ import with_statement
----

Either way, this is how you get into a transaction:

[snippet,python]
----
component=neo4j-python-embedded
source=core.py
tag=withBasedTransactions
classifier=test-sources
----

