]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
allow setattr() access to _CursorFairy directly, thereby removing the need for dialec...
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 6 Nov 2009 15:51:06 +0000 (15:51 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 6 Nov 2009 15:51:06 +0000 (15:51 +0000)
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/pool.py
test/dialect/test_oracle.py

index b6f16792e67e9f2d1d61abbb5f8ca8038ff40bbe..eb5f2cb43bf56d239a20ffd1b426e10fbab254f7 100644 (file)
@@ -234,7 +234,7 @@ class Oracle_cx_oracleExecutionContext(OracleExecutionContext):
     def create_cursor(self):
         c = self._connection.connection.cursor()
         if self.dialect.arraysize:
-            c.cursor.arraysize = self.dialect.arraysize
+            c.arraysize = self.dialect.arraysize
         return c
 
     def get_result_proxy(self):
index 45ff89d711f2fe6bb146260e1ae4b837619caa5e..0dd3438b106a9f54d19440f1fea6b8ccd47d765e 100644 (file)
@@ -431,15 +431,15 @@ class _ConnectionFairy(object):
         self._connection_record = None
 
 class _CursorFairy(object):
-    __slots__ = '__parent', 'cursor', 'execute'
+    __slots__ = '_parent', 'cursor', 'execute'
 
     def __init__(self, parent, cursor):
-        self.__parent = parent
+        self._parent = parent
         self.cursor = cursor
         self.execute = cursor.execute
         
     def invalidate(self, e=None):
-        self.__parent.invalidate(e=e)
+        self._parent.invalidate(e=e)
 
     def close(self):
         try:
@@ -453,7 +453,13 @@ class _CursorFairy(object):
 
             if isinstance(e, (SystemExit, KeyboardInterrupt)):
                 raise
-
+    
+    def __setattr__(self, key, value):
+        if key in self.__slots__:
+            object.__setattr__(self, key, value)
+        else:
+            setattr(self.cursor, key, value)
+            
     def __getattr__(self, key):
         return getattr(self.cursor, key)
 
index b5720929579b66f795cbf4a2f9c4d65ef0c41c94..57be6fe618914502c8cc9e491ff750282fa16b73 100644 (file)
@@ -243,7 +243,7 @@ class MultiSchemaTest(TestBase, AssertsCompiledSQL):
     __only_on__ = 'oracle'
 
     def test_create_same_names_explicit_schema(self):
-        schema = testing.db.dialect.get_default_schema_name(testing.db.connect())
+        schema = testing.db.dialect.default_schema_name
         meta = MetaData(testing.db)
         parent = Table('parent', meta, 
             Column('pid', Integer, primary_key=True),