diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-18 17:09:21 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-18 17:09:21 +0000 |
| commit | 89a8546d00ca5f4b59179c42a05096bc49c76c65 (patch) | |
| tree | f27db013a335fa679696a6243d17e803f99367b0 | |
| parent | 82f80559b9815da8a1695c9f266488da35eb2a97 (diff) | |
| download | sqlalchemy-89a8546d00ca5f4b59179c42a05096bc49c76c65.tar.gz | |
-removed useless log statement (merge garbage?)
- clarified autocommit mechanism
| -rw-r--r-- | doc/build/content/dbengine.txt | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/log.py | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index 0236a6f70..02f63bc2a 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 06aa47eba..762f56ef5 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__) |
