Author: shawkins
Date: 2012-04-19 14:05:03 -0400 (Thu, 19 Apr 2012)
New Revision: 4022
Modified:
branches/8.0.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java
branches/8.0.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
branches/8.0.x/client/src/main/resources/org/teiid/jdbc/i18n.properties
branches/8.0.x/client/src/main/resources/teiid-client-settings.orig.properties
Log:
TEIID-2008 allowing the maxObejctSize to be settable
Modified: branches/8.0.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java
===================================================================
--- branches/8.0.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java 2012-04-19 17:44:05
UTC (rev 4021)
+++ branches/8.0.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java 2012-04-19 18:05:03
UTC (rev 4022)
@@ -66,5 +66,6 @@
TEIID20025,
TEIID20026,
TEIID20027,
+ TEIID20028
}
}
Modified:
branches/8.0.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
===================================================================
---
branches/8.0.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2012-04-19
17:44:05 UTC (rev 4021)
+++
branches/8.0.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2012-04-19
18:05:03 UTC (rev 4022)
@@ -49,7 +49,7 @@
public final class OioOjbectChannelFactory implements ObjectChannelFactory {
private final static int STREAM_BUFFER_SIZE = 1<<15;
- private final static int MAX_OBJECT_SIZE = 1 << 25;
+ private final static int DEFAULT_MAX_OBJECT_SIZE = 1 << 25;
private static Logger log = Logger.getLogger("org.teiid.client.sockets");
//$NON-NLS-1$
@@ -59,7 +59,7 @@
private ObjectInputStream inputStream;
private Object readLock = new Object();
- private OioObjectChannel(Socket socket) throws IOException {
+ private OioObjectChannel(Socket socket, int maxObjectSize) throws IOException {
log.fine("creating new OioObjectChannel"); //$NON-NLS-1$
this.socket = socket;
BufferedOutputStream bos = new BufferedOutputStream(
socket.getOutputStream(), STREAM_BUFFER_SIZE);
@@ -69,7 +69,7 @@
outputStream.flush();
final ClassLoader cl = this.getClass().getClassLoader();
BufferedInputStream bis = new BufferedInputStream(socket.getInputStream(),
STREAM_BUFFER_SIZE);
- inputStream = new ObjectDecoderInputStream(new DataInputStream(bis), cl,
MAX_OBJECT_SIZE);
+ inputStream = new ObjectDecoderInputStream(new DataInputStream(bis), cl,
maxObjectSize);
}
@Override
@@ -145,6 +145,7 @@
private boolean conserveBandwidth;
private int soTimeout = 3000;
private volatile SSLSocketFactory sslSocketFactory;
+ private int maxObjectSize = DEFAULT_MAX_OBJECT_SIZE;
public OioOjbectChannelFactory(Properties props) {
this.props = props;
@@ -176,7 +177,7 @@
socket.setTcpNoDelay(!conserveBandwidth); // enable Nagle's algorithm to
conserve bandwidth
socket.connect(address);
socket.setSoTimeout(soTimeout);
- return new OioObjectChannel(socket);
+ return new OioObjectChannel(socket, maxObjectSize);
}
public int getSendBufferSize() {
@@ -206,6 +207,10 @@
public void setSoTimeout(int soTimeout) {
this.soTimeout = soTimeout;
}
+
+ public void setMaxObjectSize(int maxObjectSize) {
+ this.maxObjectSize = maxObjectSize;
+ }
public int getSoTimeout() {
return soTimeout;
Modified: branches/8.0.x/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- branches/8.0.x/client/src/main/resources/org/teiid/jdbc/i18n.properties 2012-04-19
17:44:05 UTC (rev 4021)
+++ branches/8.0.x/client/src/main/resources/org/teiid/jdbc/i18n.properties 2012-04-19
18:05:03 UTC (rev 4022)
@@ -171,4 +171,5 @@
</drivers>
TEIID20008=Failed to load "org.jboss.teiid" module.
TEIID20023=connection closed
-TEIID20007=Duplicate Class
\ No newline at end of file
+TEIID20007=Duplicate Class
+TEIID20028=data length too big: {0} > max of {1}. You may need to adjust the
maxObjectSize client setting.
\ No newline at end of file
Modified: branches/8.0.x/client/src/main/resources/teiid-client-settings.orig.properties
===================================================================
---
branches/8.0.x/client/src/main/resources/teiid-client-settings.orig.properties 2012-04-19
17:44:05 UTC (rev 4021)
+++
branches/8.0.x/client/src/main/resources/teiid-client-settings.orig.properties 2012-04-19
18:05:03 UTC (rev 4022)
@@ -127,3 +127,10 @@
#
org.teiid.sockets.conserveBandwidth=false
+
+#
+# Maximum number of bytes per server message.
+# May need to be increased when using custom types and/or large batch sizes.
+#
+
+org.teiid.sockets.maxObjectSize=33554432
Show replies by date