- fixed endless loop

- fixed perf imports in masseagerload
This commit is contained in:
Mike Bayer
2007-08-14 03:34:38 +00:00
parent b9ed823528
commit 6c6cd47c02
3 changed files with 6 additions and 4 deletions
+4 -1
View File
@@ -148,7 +148,8 @@ class SessionTransaction(object):
self.nested = nested
def connection(self, bindkey, **kwargs):
return self.session.connection(bindkey, **kwargs)
engine = self.session.get_bind(bindkey, **kwargs)
return self.get_or_add(engine)
def _begin(self, **kwargs):
return SessionTransaction(self.session, self, **kwargs)
@@ -623,6 +624,8 @@ class Session(object):
else:
if isinstance(mapper, type):
mapper = _class_mapper(mapper)
else:
mapper = mapper.compile()
e = mapper.mapped_table.bind
if e is None:
raise exceptions.InvalidRequestError("Could not locate any Engine or Connection bound to mapper '%s'" % str(mapper))
-1
View File
@@ -1,5 +1,4 @@
import testbase
import hotshot, hotshot.stats
from sqlalchemy import *
from sqlalchemy.orm import *
from testlib import *
+2 -2
View File
@@ -7,10 +7,10 @@ import testlib.config
from testlib.schema import Table, Column
import testlib.testing as testing
from testlib.testing import PersistTest, AssertMixin, ORMTest, SQLCompileTest
import testlib.profiling
import testlib.profiling as profiling
import testlib.engines
__all__ = ('testing',
'Table', 'Column',
'PersistTest', 'AssertMixin', 'ORMTest', 'SQLCompileTest')
'PersistTest', 'AssertMixin', 'ORMTest', 'SQLCompileTest', 'profiling')