Skip to content

Commit d52e41e

Browse files
committed
Merge branch '1.0' into 1.1
2 parents 19e3d42 + eb9441f commit d52e41e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Example Usage
3131
result = session.run("MATCH (a:Person) RETURN a.name AS name")
3232
for record in result:
3333
print(record["name"])
34-
result.close()
3534
session.close()
3635
3736

examples/test_examples.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ def test_transaction_commit(self):
176176
driver = GraphDatabase.driver("bolt://localhost", auth=auth_token)
177177
session = driver.session()
178178
# tag::transaction-commit[]
179-
tx = session.begin_transaction()
180-
tx.run("CREATE (:Person {name: 'Guinevere'})")
181-
tx.commit()
179+
with session.begin_transaction() as tx:
180+
tx.run("CREATE (:Person {name: 'Guinevere'})")
181+
tx.success = True
182182
# end::transaction-commit[]
183183
result = session.run("MATCH (p:Person {name: 'Guinevere'}) RETURN count(p)")
184184
record = next(iter(result))
@@ -189,9 +189,9 @@ def test_transaction_rollback(self):
189189
driver = GraphDatabase.driver("bolt://localhost", auth=auth_token)
190190
session = driver.session()
191191
# tag::transaction-rollback[]
192-
tx = session.begin_transaction()
193-
tx.run("CREATE (:Person {name: 'Merlin'})")
194-
tx.rollback()
192+
with session.begin_transaction() as tx:
193+
tx.run("CREATE (:Person {name: 'Merlin'})")
194+
tx.success = False
195195
# end::transaction-rollback[]
196196
result = session.run("MATCH (p:Person {name: 'Merlin'}) RETURN count(p)")
197197
record = next(iter(result))

0 commit comments

Comments
 (0)