[Checkins] SVN: relstorage/branches/1.1/ Merge from trunk (-r95361:96084)

Shane Hathaway shane at hathawaymix.org
Wed Feb 4 15:56:09 EST 2009


Log message for revision 96087:
  Merge from trunk (-r95361:96084)
  

Changed:
  U   relstorage/branches/1.1/CHANGES.txt
  A   relstorage/branches/1.1/LICENSE.txt
  U   relstorage/branches/1.1/README.txt
  U   relstorage/branches/1.1/relstorage/adapters/mysql.py
  U   relstorage/branches/1.1/relstorage/adapters/oracle.py
  U   relstorage/branches/1.1/relstorage/adapters/postgresql.py
  U   relstorage/branches/1.1/setup.py

-=-
Modified: relstorage/branches/1.1/CHANGES.txt
===================================================================
--- relstorage/branches/1.1/CHANGES.txt	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/CHANGES.txt	2009-02-04 20:56:09 UTC (rev 96087)
@@ -2,8 +2,21 @@
 Next Release
 ------------
 
+- ...
 
 
+Version 1.1.3 (2009-02-04)
+--------------------------
+
+- In rare circumstances, ZODB can legitimately commit an object twice in a
+  single transaction.  Fixed RelStorage to accept that.
+
+- Auto reconnect to Oracle sometimes did not work because cx_Oracle was
+  raising a different kind of exception than expected.  Fixed.
+
+- Included LICENSE.txt in the source distribution.
+
+
 Version 1.1.2 (2009-01-27)
 --------------------------
 

Copied: relstorage/branches/1.1/LICENSE.txt (from rev 96084, relstorage/trunk/LICENSE.txt)
===================================================================
--- relstorage/branches/1.1/LICENSE.txt	                        (rev 0)
+++ relstorage/branches/1.1/LICENSE.txt	2009-02-04 20:56:09 UTC (rev 96087)
@@ -0,0 +1,54 @@
+Zope Public License (ZPL) Version 2.1
+-------------------------------------
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+   accompanying copyright notice, this list of conditions,
+   and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+   copyright notice, this list of conditions, and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+   endorse or promote products derived from this software
+   without prior written permission from the copyright
+   holders.
+
+4. The right to distribute this software or to use it for
+   any purpose does not give you the right to use
+   Servicemarks (sm) or Trademarks (tm) of the copyright
+   holders. Use of them is covered by separate agreement
+   with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+   files to carry prominent notices stating that you changed
+   the files and the date of any change.
+
+Disclaimer
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
+  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+  NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.

Modified: relstorage/branches/1.1/README.txt
===================================================================
--- relstorage/branches/1.1/README.txt	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/README.txt	2009-02-04 20:56:09 UTC (rev 96087)
@@ -1,13 +1,12 @@
 
-Overview
-========
-
 RelStorage is a storage implementation for ZODB that stores pickles in a
 relational database.  PostgreSQL 8.1 and above (via psycopg2), MySQL 5.0.x (via
 MySQLdb 1.2.2 and above), and Oracle 10g (via cx_Oracle) are currently
 supported.  RelStorage replaces the PGStorage project.
 
+.. contents::
 
+
 Features
 ========
 
@@ -96,15 +95,19 @@
      </relstorage>
     </zodb_db>
 
+
+Migration
+=========
+
 Migrating from FileStorage
-==========================
+--------------------------
 
 You can convert a FileStorage instance to RelStorage and back using a utility
 called ZODBConvert.  See http://wiki.zope.org/ZODB/ZODBConvert .
 
 
 Migrating from PGStorage
-========================
+------------------------
 
 The following script migrates your database from PGStorage to RelStorage 1.0
 beta:
@@ -118,12 +121,12 @@
 
 
 Migrating to a new version of RelStorage
-========================================
+----------------------------------------
 
 Sometimes RelStorage needs a schema modification along with a software
 upgrade.  Hopefully, this will not often be necessary.
 
-To migrate from version 1.1.1 to version 1.1.2, see:
+To migrate from version 1.1.1 to version 1.1.2 or 1.1.3, see:
 
   migrate-to-1.1.2.txt_
 

Modified: relstorage/branches/1.1/relstorage/adapters/mysql.py
===================================================================
--- relstorage/branches/1.1/relstorage/adapters/mysql.py	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/relstorage/adapters/mysql.py	2009-02-04 20:56:09 UTC (rev 96087)
@@ -59,7 +59,15 @@
 
 commit_lock_timeout = 30
 
+# disconnected_exceptions contains the exception types that might be
+# raised when the connection to the database has been broken.
+disconnected_exceptions = (MySQLdb.OperationalError, MySQLdb.InterfaceError)
 
+# close_exceptions contains the exception types to ignore
+# when the adapter attempts to close a database connection.
+close_exceptions = disconnected_exceptions + (MySQLdb.ProgrammingError,)
+
+
 class MySQLAdapter(Adapter):
     """MySQL adapter for RelStorage."""
 
@@ -290,9 +298,7 @@
             if obj is not None:
                 try:
                     obj.close()
-                except (MySQLdb.InterfaceError,
-                        MySQLdb.OperationalError,
-                        MySQLdb.ProgrammingError):
+                except close_exceptions:
                     pass
 
     def open_for_load(self):
@@ -306,7 +312,7 @@
         """Reinitialize a connection for loading objects."""
         try:
             cursor.connection.rollback()
-        except (MySQLdb.OperationalError, MySQLdb.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def get_object_count(self):
@@ -458,7 +464,7 @@
         try:
             cursor.connection.rollback()
             self._restart_temp_table(cursor)
-        except (MySQLdb.OperationalError, MySQLdb.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def store_temp(self, cursor, oid, prev_tid, md5sum, data):

Modified: relstorage/branches/1.1/relstorage/adapters/oracle.py
===================================================================
--- relstorage/branches/1.1/relstorage/adapters/oracle.py	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/relstorage/adapters/oracle.py	2009-02-04 20:56:09 UTC (rev 96087)
@@ -24,6 +24,11 @@
 
 log = logging.getLogger("relstorage.adapters.oracle")
 
+# disconnected_exceptions contains the exception types that might be
+# raised when the connection to the database has been broken.
+disconnected_exceptions = (cx_Oracle.OperationalError,
+    cx_Oracle.InterfaceError, cx_Oracle.DatabaseError)
+
 def lob_handler(cursor, name, defaultType, size, precision, scale):
     """cx_Oracle outputtypehandler that causes Oracle to send BLOBs inline.
 
@@ -334,8 +339,7 @@
             if obj is not None:
                 try:
                     obj.close()
-                except (cx_Oracle.InterfaceError,
-                        cx_Oracle.OperationalError):
+                except disconnected_exceptions:
                     pass
 
     def open_for_load(self):
@@ -350,7 +354,7 @@
         try:
             cursor.connection.rollback()
             cursor.execute("SET TRANSACTION READ ONLY")
-        except (cx_Oracle.OperationalError, cx_Oracle.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def get_object_count(self):
@@ -531,7 +535,7 @@
             cursor.connection.rollback()
             if self._twophase:
                 self._set_xid(cursor)
-        except (cx_Oracle.OperationalError, cx_Oracle.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def store_temp(self, cursor, oid, prev_tid, md5sum, data):

Modified: relstorage/branches/1.1/relstorage/adapters/postgresql.py
===================================================================
--- relstorage/branches/1.1/relstorage/adapters/postgresql.py	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/relstorage/adapters/postgresql.py	2009-02-04 20:56:09 UTC (rev 96087)
@@ -23,7 +23,11 @@
 
 log = logging.getLogger("relstorage.adapters.postgresql")
 
+# disconnected_exceptions contains the exception types that might be
+# raised when the connection to the database has been broken.
+disconnected_exceptions = (psycopg2.OperationalError, psycopg2.InterfaceError)
 
+
 class PostgreSQLAdapter(Adapter):
     """PostgreSQL adapter for RelStorage."""
 
@@ -202,8 +206,7 @@
             if obj is not None:
                 try:
                     obj.close()
-                except (psycopg2.InterfaceError,
-                        psycopg2.OperationalError):
+                except disconnected_exceptions:
                     pass
 
     def _pg_version(self, cursor):
@@ -241,7 +244,7 @@
         """Reinitialize a connection for loading objects."""
         try:
             cursor.connection.rollback()
-        except (psycopg2.OperationalError, psycopg2.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def get_object_count(self):
@@ -409,7 +412,7 @@
                 cursor.connection.set_isolation_level(
                     psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED)
             self._make_temp_table(cursor)
-        except (psycopg2.OperationalError, psycopg2.InterfaceError), e:
+        except disconnected_exceptions, e:
             raise StorageError(e)
 
     def store_temp(self, cursor, oid, prev_tid, md5sum, data):

Modified: relstorage/branches/1.1/setup.py
===================================================================
--- relstorage/branches/1.1/setup.py	2009-02-04 20:55:43 UTC (rev 96086)
+++ relstorage/branches/1.1/setup.py	2009-02-04 20:56:09 UTC (rev 96087)
@@ -13,7 +13,7 @@
 ##############################################################################
 """A backend for ZODB that stores pickles in a relational database."""
 
-VERSION = "1.1.3dev"
+VERSION = "1.1.3"
 
 # The choices for the Trove Development Status line:
 # Development Status :: 5 - Production/Stable



More information about the Checkins mailing list