Author: jolee
Date: 2013-07-29 16:04:30 -0400 (Mon, 29 Jul 2013)
New Revision: 4581
Modified:
branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java
Log:
TEIID-2598: 7.4 compatibility
Modified: branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java 2013-07-12
07:20:42 UTC (rev 4580)
+++ branches/7.7.x/client/src/main/java/org/teiid/client/BatchSerializer.java 2013-07-29
20:04:30 UTC (rev 4581)
@@ -562,7 +562,20 @@
}
public static List<List<Object>> readBatch(ObjectInput in, String[]
types, byte version) throws IOException, ClassNotFoundException {
- int rows = in.readInt();
+ int rows = 0;
+ try {
+ rows = in.readInt();
+ } catch (IOException e) {
+ //7.4 compatibility
+ if (types == null || types.length == 0) {
+ List<Object>[] result = (List[])in.readObject();
+ ArrayList<List<Object>> batch = new
ArrayList<List<Object>>();
+ batch.addAll(Arrays.asList(result));
+ return batch;
+ }
+ throw e;
+ }
+
if (rows == 0) {
return new ArrayList<List<Object>>(0);
} else if (rows > 0) {
Show replies by date