From: Mike Bayer Date: Sun, 18 May 2008 17:09:21 +0000 (+0000) Subject: -removed useless log statement (merge garbage?) X-Git-Tag: rel_0_5beta1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89a8546d00ca5f4b59179c42a05096bc49c76c65;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git -removed useless log statement (merge garbage?) - clarified autocommit mechanism --- 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__)