]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- zoomark/zoomark_orm seem to work with pool_threadlocal turned off, [ticket:1050...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 May 2008 22:35:32 +0000 (22:35 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 May 2008 22:35:32 +0000 (22:35 +0000)
- fixed probably errenous unique=True checkin on unitofwork.py

lib/sqlalchemy/pool.py
test/orm/unitofwork.py
test/profiling/zoomark.py
test/profiling/zoomark_orm.py

index 7a9932e8b3488c45a45b86999958cf746fda9622..a94cd28f38ccd516f654b17f3a407394a4b461ca 100644 (file)
@@ -118,7 +118,6 @@ class Pool(object):
     """
     def __init__(self, creator, recycle=-1, echo=None, use_threadlocal=False,
                  reset_on_return=True, listeners=None):
-
         self.logger = log.instance_logger(self, echoflag=echo)
         # the WeakValueDictionary works more nicely than a regular dict of
         # weakrefs.  the latter can pile up dead reference objects which don't
index 926dc6ff07810dcd6db695a9bb64ffd7ef1b3062..c91c9854c3029a49c6ae9651a9457a7a63715080 100644 (file)
@@ -835,7 +835,7 @@ class DefaultTest(_base.MappedTest):
         dt = Table('default_t', metadata,
             Column('id', Integer, primary_key=True,
                    test_needs_autoincrement=True),
-            Column('hoho', hohotype, server_default=str(hohoval), unique=True),
+            Column('hoho', hohotype, server_default=str(hohoval)),
             Column('counter', Integer, default=sa.func.char_length("1234567")),
             Column('foober', String(30), default="im foober",
                    onupdate="im the update"))
index 69f236ef19d328bd12d68f5adad58803132594d8..e0d696ae4e518fc88883a93739fad2b02deb4872 100644 (file)
@@ -35,7 +35,7 @@ class ZooMarkTest(TestBase):
 
         creator = testing.db.pool._creator
         recorder = lambda: dbapi_session.recorder(creator())
-        engine = engines.testing_engine(options={'creator':recorder, 'pool_threadlocal':True}) # TODO: shouldnt need threadlocal pool
+        engine = engines.testing_engine(options={'creator':recorder})
         metadata = MetaData(engine)
 
     def test_baseline_1_create_tables(self):
@@ -317,7 +317,7 @@ class ZooMarkTest(TestBase):
         global metadata
 
         player = lambda: dbapi_session.player()
-        engine = create_engine('postgres:///', creator=player, pool_threadlocal=True) # TODO: shouldnt need threadlocal pool
+        engine = create_engine('postgres:///', creator=player)
         metadata = MetaData(engine)
 
     @profiling.function_call_count(3230, {'2.4': 1796})
@@ -336,15 +336,15 @@ class ZooMarkTest(TestBase):
     def test_profile_3_properties(self):
         self.test_baseline_3_properties()
 
-    @profiling.function_call_count(18119, {'2.4': 10549})
+    @profiling.function_call_count(17098, {'2.4': 10549})
     def test_profile_4_expressions(self):
         self.test_baseline_4_expressions()
 
-    @profiling.function_call_count(1617, {'2.4': 1032})
+    @profiling.function_call_count(1523, {'2.4': 1032})
     def test_profile_5_aggregates(self):
         self.test_baseline_5_aggregates()
 
-    @profiling.function_call_count(1882, {'2.4': 1048})
+    @profiling.function_call_count(2054, {'2.4': 1048})
     def test_profile_6_editing(self):
         self.test_baseline_6_editing()
 
index 98b616efa51ea11d6ab4e8d1f3ea583a491ab2b8..f347be52ccf85e17a08d48775ac77b088c810aae 100644 (file)
@@ -38,7 +38,7 @@ class ZooMarkTest(TestBase):
         recorder = lambda: dbapi_session.recorder(creator())
         engine = engines.testing_engine(options={'creator':recorder})
         metadata = MetaData(engine)
-        session = sessionmaker(bind=engine)()  # the recorder seems to have a dependency on being bound to the engine here
+        session = sessionmaker()()
 
     def test_baseline_1_create_tables(self):
         zoo = Table('Zoo', metadata,