Index: django/db/backends/oracle/base.py
===================================================================
--- django/db/backends/oracle/base.py	(revision 7934)
+++ django/db/backends/oracle/base.py	(working copy)
@@ -33,6 +33,24 @@
     interprets_empty_strings_as_nulls = True
     date_field_supports_time_value = False
 
+class DatabasePool:
+    def __get__(self):
+        if hasattr(self,'_pool'):
+            return self._pool
+        else:
+            from django.conf import settings
+            if len(settings.DATABASE_HOST.strip()) == 0:
+                settings.DATABASE_HOST = 'localhost'
+            if len(settings.DATABASE_PORT.strip()) != 0:
+                dsn = Database.makedsn(settings.DATABASE_HOST, int(settings.DATABASE_PORT), settings.DATABASE_NAME)
+                # FIXME. make the Pool parameters inside the settings
+                self._pool = cx_Oracle.SessionPool(settings.DATABASE_USER, settings.DATABASE_PASSWORD, dsn, 2, 12, 1)
+
+            else:
+                # FIXME. make the Pool parameters inside the settings
+                self._pool = cx_Oracle.SessionPool(settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME, 2, 12, 1)
+            return self._pool
+
 class DatabaseOperations(BaseDatabaseOperations):
     def autoinc_sql(self, table, column):
         # To simulate auto-incrementing primary keys in Oracle, we have to
@@ -199,21 +217,37 @@
         'iendswith': "LIKEC UPPER(%s) ESCAPE '\\'",
     }
     oracle_version = None
-
-    def _valid_connection(self):
-        return self.connection is not None
-
-    def _cursor(self, settings):
-        cursor = None
-        if not self._valid_connection():
+    
+    def _get_pool (self):
+        if not hasattr (self.__class__, '_pool'):
+            from django.conf import settings
+            Database.OPT_Threading = 1
             if len(settings.DATABASE_HOST.strip()) == 0:
                 settings.DATABASE_HOST = 'localhost'
             if len(settings.DATABASE_PORT.strip()) != 0:
                 dsn = Database.makedsn(settings.DATABASE_HOST, int(settings.DATABASE_PORT), settings.DATABASE_NAME)
-                self.connection = Database.connect(settings.DATABASE_USER, settings.DATABASE_PASSWORD, dsn, **self.options)
+                # FIXME. make the Pool parameters inside the settings
+                p = Database.SessionPool(settings.DATABASE_USER, settings.DATABASE_PASSWORD, dsn, 10, 100, 10, threaded = True)
+
             else:
-                conn_string = "%s/%s@%s" % (settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME)
-                self.connection = Database.connect(conn_string, **self.options)
+                # FIXME. make the Pool parameters inside the settings
+                p = Database.SessionPool(settings.DATABASE_USER, settings.DATABASE_PASSWORD, settings.DATABASE_NAME, 10, 100, 10, threaded = True)
+            setattr(self.__class__, '_pool', p)
+
+        return getattr(self.__class__, '_pool')
+        
+        
+    pool = property (_get_pool)
+	
+    def _cursor(self, settings):
+        cursor = None
+        print self.pool
+        if self.pool is not None:
+            if self.connection is None:
+                self.connection = self.pool.acquire()
+                print "DEBUG: acquire session "
+            print self.connection
+        	
             cursor = FormatStylePlaceholderCursor(self.connection)
             # Set oracle date to ansi date format.  This only needs to execute
             # once when we create a new connection.
@@ -237,12 +271,24 @@
                 # Django docs specify cx_Oracle version 4.3.1 or higher, but
                 # stmtcachesize is available only in 4.3.2 and up.
                 pass
+        else:
+            print "Nonono, David Blain"
+        
         if not cursor:
             cursor = FormatStylePlaceholderCursor(self.connection)
         # Default arraysize of 1 is highly sub-optimal.
         cursor.arraysize = 100
         return cursor
 
+    def close(self):
+        if self.connection is not None:
+            print "DEBUG: Release session "
+            print self.connection
+            
+            self.pool.release(self.connection)
+            self.connection = None
+
+
 class FormatStylePlaceholderCursor(Database.Cursor):
     """
     Django uses "format" (e.g. '%s') style placeholders, but Oracle uses ":var"
