Permalink
Browse files

set_isolation_level() example in tests.py

  • Loading branch information...
1 parent c29f621 commit 54215908ea210068497d9eff67b5143ae1052ef5 @nakagami committed Mar 31, 2011
Showing with 11 additions and 1 deletion.
  1. +1 −1 firebirdsql/fbcore.py
  2. +10 −0 firebirdsql/tests.py
@@ -1107,7 +1107,7 @@ def __init__(self, dsn, user, password, charset=DEFAULT_CHARSET, port=3050):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((self.hostname, self.port))
- def set_isolation_level(isolation_level):
+ def set_isolation_level(self, isolation_level):
self.isolation_level = isolation_level
def info_database(self, info_names):
View
@@ -69,6 +69,16 @@
for c in cur.fetchall():
print(c)
conn.close()
+
+ conn = firebirdsql.connect(TEST_DSN, TEST_USER, TEST_PASS, port=3050)
+ conn.set_isolation_level(firebirdsql.ISOLATION_LEVEL_SERIALIZABLE)
+ cur = conn.cursor()
+ cur.execute("select * from foo")
+ print(cur.description)
+ for c in cur.fetchall():
+ print(c)
+ conn.close()
+
print('backup database')
svc = firebirdsql.service_mgr(TEST_DSN, TEST_USER, TEST_PASS, port=3050)
svc.backup_database(TEST_BACKUP_FILE, sys.stdout)

0 comments on commit 5421590

Please sign in to comment.