[teiid-commits] teiid SVN: r3895 - in branches/7.7.x: documentation/reference/src/main/docbook/en-US/content and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Feb 27 09:39:53 EST 2012


Author: shawkins
Date: 2012-02-27 09:39:52 -0500 (Mon, 27 Feb 2012)
New Revision: 3895

Modified:
   branches/7.7.x/common-core/src/main/java/org/teiid/core/types/BlobType.java
   branches/7.7.x/common-core/src/main/java/org/teiid/core/types/ClobType.java
   branches/7.7.x/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1937 adding checks for lob length and adding a note about large mysql result sets

Modified: branches/7.7.x/common-core/src/main/java/org/teiid/core/types/BlobType.java
===================================================================
--- branches/7.7.x/common-core/src/main/java/org/teiid/core/types/BlobType.java	2012-02-23 21:04:48 UTC (rev 3894)
+++ branches/7.7.x/common-core/src/main/java/org/teiid/core/types/BlobType.java	2012-02-27 14:39:52 UTC (rev 3895)
@@ -151,7 +151,7 @@
 		try {
 			writeBinary(out, getBinaryStream(), (int)length);
 		} catch (SQLException e) {
-			throw new IOException();
+			throw new IOException(e);
 		}
 	}
 
@@ -164,7 +164,10 @@
 			}
 		};
 		try {
-			ObjectConverterUtil.write(os, is, length, false);
+			int bytes = ObjectConverterUtil.write(os, is, length, false);
+			if (bytes != length) {
+				throw new IOException("Expected length " + length + " but was " + bytes); //$NON-NLS-1$ //$NON-NLS-2$
+			}
 		} finally {
 			is.close();
 		}

Modified: branches/7.7.x/common-core/src/main/java/org/teiid/core/types/ClobType.java
===================================================================
--- branches/7.7.x/common-core/src/main/java/org/teiid/core/types/ClobType.java	2012-02-23 21:04:48 UTC (rev 3894)
+++ branches/7.7.x/common-core/src/main/java/org/teiid/core/types/ClobType.java	2012-02-27 14:39:52 UTC (rev 3895)
@@ -240,7 +240,7 @@
 			@Override
 			public void write(char[] cbuf, int off, int len) throws IOException {
 				for (int i = off; i < len; i++) {
-					out.writeShort(cbuf[i]);
+					out.writeChar(cbuf[i]);
 				}
 			}
 			
@@ -259,7 +259,10 @@
 			throw new IOException(e);
 		}
 		try {
-			ObjectConverterUtil.write(w, r, (int)length, false);
+			int chars = ObjectConverterUtil.write(w, r, (int)length, false);
+			if (length != chars) {
+				throw new IOException("Expected length " + length + " but was " + chars + " for " + this.reference); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			}
 		} finally {
 			r.close();
 		}

Modified: branches/7.7.x/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- branches/7.7.x/documentation/reference/src/main/docbook/en-US/content/translators.xml	2012-02-23 21:04:48 UTC (rev 3894)
+++ branches/7.7.x/documentation/reference/src/main/docbook/en-US/content/translators.xml	2012-02-27 14:39:52 UTC (rev 3895)
@@ -120,6 +120,12 @@
                         Values less than 1 indicate to use only one in predicate per dependent value pushed (which matches the pre-7.4 behavior).</entry>
                         <entry>-1</entry>
                     </row>
+                    <row>
+                        <entry>CopyLobs</entry>
+                        <entry>If true, then returned lobs (clob, blob, sql/xml) will be copied by the engine in a memory safe manner.  
+                        Use this option if the source does not support memory safe lobs or you want to disconnect lobs from the source connection.</entry>
+                        <entry>false</entry>
+                    </row>
                 </tbody>
             </tgroup>
         </table>
@@ -330,6 +336,7 @@
                     <programlisting>set SESSION sql_mode = 'ANSI'</programlisting>
                     <para>If retrieving timestamp values, you should set zeroDateTimeBehavior=convertToNull on the URL, otherwise MySQL or Teiid may throw an exception
                     retriieving '0000-00-00 00:00:00'</para>
+                    <para>If retrieving large result sets, you should consider setting useCursorFetch=true on the URL, otherwise MySQL will fully fetch result sets into memory on the Teiid instance.</para>
                 </listitem>
                 <listitem>
                     <para>



More information about the teiid-commits mailing list