[Checkins] SVN: relstorage/branches/1.2/ Created the 1.2 branch with the bug fix just added

Shane Hathaway shane at hathawaymix.org
Mon Aug 24 11:29:02 EDT 2009


Log message for revision 103158:
  Created the 1.2 branch with the bug fix just added
  

Changed:
  A   relstorage/branches/1.2/
  U   relstorage/branches/1.2/CHANGES.txt
  U   relstorage/branches/1.2/relstorage/adapters/oracle.py
  U   relstorage/branches/1.2/relstorage/tests/reltestbase.py

-=-

Property changes on: relstorage/branches/1.2
___________________________________________________________________
Added: svn:ignore
   + nbproject
develop-eggs
parts
.installed.cfg
coverage
bin
RelStorage.egg-info
eggs
dist



Modified: relstorage/branches/1.2/CHANGES.txt
===================================================================
--- relstorage/tags/1.2.0b2/CHANGES.txt	2009-08-24 15:25:56 UTC (rev 103157)
+++ relstorage/branches/1.2/CHANGES.txt	2009-08-24 15:29:02 UTC (rev 103158)
@@ -1,4 +1,11 @@
 
+Next Bug Fix Release
+--------------------
+
+- In Oracle, don't trip over transaction descriptions longer than 2000
+  bytes.
+
+
 Version 1.2.0b2 (2009-05-05)
 ----------------------------
 

Modified: relstorage/branches/1.2/relstorage/adapters/oracle.py
===================================================================
--- relstorage/tags/1.2.0b2/relstorage/adapters/oracle.py	2009-08-24 15:25:56 UTC (rev 103157)
+++ relstorage/branches/1.2/relstorage/adapters/oracle.py	2009-08-24 15:29:02 UTC (rev 103158)
@@ -629,7 +629,11 @@
             (tid, packed, username, description, extension)
         VALUES (:1, :2, :3, :4, :5)
         """
-        encoding = cursor.connection.encoding
+        max_desc_len = 2000
+        if len(description) > max_desc_len:
+            log.warning('Trimming description of transaction %s '
+                'to %d characters', tid, max_desc_len)
+            description = description[:max_desc_len]
         cursor.execute(stmt, (
             tid, packed and 'Y' or 'N', cx_Oracle.Binary(username),
             cx_Oracle.Binary(description), cx_Oracle.Binary(extension)))

Modified: relstorage/branches/1.2/relstorage/tests/reltestbase.py
===================================================================
--- relstorage/tags/1.2.0b2/relstorage/tests/reltestbase.py	2009-08-24 15:25:56 UTC (rev 103157)
+++ relstorage/branches/1.2/relstorage/tests/reltestbase.py	2009-08-24 15:29:02 UTC (rev 103158)
@@ -277,6 +277,18 @@
         finally:
             db.close()
 
+    def checkLongTransactionDescription(self):
+        # Don't trip over long transaction descriptions
+        db = DB(self._storage)
+        try:
+            c = db.open()
+            r = c.root()
+            r['key'] = 1
+            transaction.get().note('A long description. ' * 1000)
+            transaction.commit()
+        finally:
+            db.close()
+
     def checkAutoReconnect(self):
         # Verify auto-reconnect
         db = DB(self._storage)



More information about the Checkins mailing list