From 89a8546d00ca5f4b59179c42a05096bc49c76c65 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 18 May 2008 17:09:21 +0000 Subject: [PATCH] -removed useless log statement (merge garbage?) - clarified autocommit mechanism --- doc/build/content/dbengine.txt | 2 +- lib/sqlalchemy/log.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index 0236a6f70f..02f63bc2ab 100644 --- a/doc/build/content/dbengine.txt +++ b/doc/build/content/dbengine.txt @@ -235,7 +235,7 @@ Transaction Facts: #### Understanding Autocommit -The above transaction example illustrates how to use `Transaction` so that several executions can take part in the same transaction. What happens when we issue an INSERT, UPDATE or DELETE call without using `Transaction`? The answer is **autocommit**. While many DBAPIs implement a flag called `autocommit`, the current SQLAlchemy behavior is such that it implements its own autocommit. This is achieved by searching the statement for strings like INSERT, UPDATE, DELETE, etc. and then issuing a COMMIT automatically if no transaction is in progress. +The above transaction example illustrates how to use `Transaction` so that several executions can take part in the same transaction. What happens when we issue an INSERT, UPDATE or DELETE call without using `Transaction`? The answer is **autocommit**. While many DBAPIs implement a flag called `autocommit`, the current SQLAlchemy behavior is such that it implements its own autocommit. This is achieved by detecting statements which represent data-changing operations, i.e. INSERT, UPDATE, DELETE, etc., and then issuing a COMMIT automatically if no transaction is in progress. The detection is based on compiled statement attributes, or in the case of a text-only statement via regular expressions. {python} conn = engine.connect() diff --git a/lib/sqlalchemy/log.py b/lib/sqlalchemy/log.py index 06aa47eba6..762f56ef53 100644 --- a/lib/sqlalchemy/log.py +++ b/lib/sqlalchemy/log.py @@ -56,8 +56,6 @@ def _get_instance_name(instance): return "%s.%s.0x..%s" % (instance.__class__.__module__, instance.__class__.__name__, hex(id(instance))[-2:]) - return (instance.__class__.__module__ + "." + instance.__class__.__name__ + - ".0x.." + hex(id(instance))[-2:]) def class_logger(cls): return logging.getLogger(cls.__module__ + "." + cls.__name__) -- 2.47.3