[JBoss JIRA] (TEIID-4297) Add UDF functions based on OSDQ for POC
by JieRen JieRen (JIRA)
[ https://issues.jboss.org/browse/TEIID-4297?page=com.atlassian.jira.plugin... ]
JieRen JieRen edited comment on TEIID-4297 at 6/27/16 6:34 AM:
---------------------------------------------------------------
Hi Ramesh:
I am not sure whether I understand this task . I would like to show my steps that you can check whether I am correct.
* Create Maskutil class
Create Maskutil class as above
* Install Module
Build Maskutil ,Install Maskutil module
* Define virtual function
Define virtual function in VDB deploy file.
----
<model name="VituralFunction" type="VIRTUAL">
<metadata type="DDL"><![CDATA[
CREATE VIRTUAL FUNCTION random(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toRandomValue');
CREATE VIRTUAL FUNCTION hash(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toHashValue');
CREATE VIRTUAL FUNCTION digit(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toDigitValue');
]]> </metadata>
</model>
----
* Test UDF
----
mvn -s ../settings.xml exec:java -Dvdb="Portfolio" -Dsql="select * from product where symbol=hash()" -Dusername="odataUser" -Dpassword="password1!"
----
That's all.
If I don't get your point, please forgive me and describe this issue in detail. Thank you a lot.
was (Author: jren):
Hi Ramesh:
I am not sure whether I understand this task . I would like to show my steps that you can check whether I am correct.
* Create Maskutil class
Create Maskutil class as above
* Install Module
Build Maskutil ,Install Maskutil module
* Define virtual function
Define virtual function in VDB deploy file.
----
<model name="VituralFunction" type="VIRTUAL">
<metadata type="DDL"><![CDATA[
CREATE VIRTUAL FUNCTION random(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toRandomValue');
CREATE VIRTUAL FUNCTION hash(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toHashValue');
CREATE VIRTUAL FUNCTION digit(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toDigitValue');
]]> </metadata>
</model>
----
* Test UDF
~~~
mvn -s ../settings.xml exec:java -Dvdb="Portfolio" -Dsql="select * from product where symbol=hash()" -Dusername="odataUser" -Dpassword="password1!"
~~~
That's all.
If I don't get your point, please forgive me and describe this issue in detail. Thank you a lot.
> Add UDF functions based on OSDQ for POC
> ---------------------------------------
>
> Key: TEIID-4297
> URL: https://issues.jboss.org/browse/TEIID-4297
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: JieRen JieRen
> Fix For: 9.1
>
>
> Please add following UDF functions to Teiid library based on maven module
> http://search.maven.org/#search%7Cga%7C1%7Carrahtec
> The UDF functions needs to from this class below
> {code}
> public class Maskutil {
> /**
> * @param a
> * The string that need to randomize
> * vivek singh' will become 'ihg vkeivh'
> */
> public static String toRandomValue(String a) {
> return ShuffleRTM.shuffleString(a);
> }
> /**
> * @param a
> * This function will retrun MD5 hashcode of the string
> * @return String
> */
> public static String toHashValue(String a) {
> if (a == null)
> return "d41d8cd98f00b204e9800998ecf8427e"; // null MD5 value
> return ResultsetToRTM.getMD5(a).toString();
> }
> /**
> * @param a
> * This function will return digit characters of the string
> * @return
> *
> */
> public static String toDigitValue(String a) {
> return StringCaseFormatUtil.digitString(a);
> }
> }
> {code}
> for example Teiid should have UDF functions like
> {code}
> string random(string)
> string hash(string)
> string digit(string)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years
[JBoss JIRA] (TEIID-4297) Add UDF functions based on OSDQ for POC
by JieRen JieRen (JIRA)
[ https://issues.jboss.org/browse/TEIID-4297?page=com.atlassian.jira.plugin... ]
JieRen JieRen commented on TEIID-4297:
--------------------------------------
Hi Ramesh:
I am not sure whether I understand this task . I would like to show my steps that you can check whether I am correct.
* Create Maskutil class
Create Maskutil class as above
* Install Module
Build Maskutil ,Install Maskutil module
* Define virtual function
Define virtual function in VDB deploy file.
~~~
<model name="VituralFunction" type="VIRTUAL">
<metadata type="DDL"><![CDATA[
CREATE VIRTUAL FUNCTION random(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toRandomValue');
CREATE VIRTUAL FUNCTION hash(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toHashValue');
CREATE VIRTUAL FUNCTION digit(className string) RETURNS string OPTIONS (JAVA_CLASS 'org.teiid.Maskutil', JAVA_METHOD 'toDigitValue');
]]> </metadata>
</model>
~~~
* Test UDF
~~~
mvn -s ../settings.xml exec:java -Dvdb="Portfolio" -Dsql="select * from product where symbol=hash()" -Dusername="odataUser" -Dpassword="password1!"
~~~
That's all.
If I don't get your point, please forgive me and describe this issue in detail. Thank you a lot.
> Add UDF functions based on OSDQ for POC
> ---------------------------------------
>
> Key: TEIID-4297
> URL: https://issues.jboss.org/browse/TEIID-4297
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Reporter: Ramesh Reddy
> Assignee: JieRen JieRen
> Fix For: 9.1
>
>
> Please add following UDF functions to Teiid library based on maven module
> http://search.maven.org/#search%7Cga%7C1%7Carrahtec
> The UDF functions needs to from this class below
> {code}
> public class Maskutil {
> /**
> * @param a
> * The string that need to randomize
> * vivek singh' will become 'ihg vkeivh'
> */
> public static String toRandomValue(String a) {
> return ShuffleRTM.shuffleString(a);
> }
> /**
> * @param a
> * This function will retrun MD5 hashcode of the string
> * @return String
> */
> public static String toHashValue(String a) {
> if (a == null)
> return "d41d8cd98f00b204e9800998ecf8427e"; // null MD5 value
> return ResultsetToRTM.getMD5(a).toString();
> }
> /**
> * @param a
> * This function will return digit characters of the string
> * @return
> *
> */
> public static String toDigitValue(String a) {
> return StringCaseFormatUtil.digitString(a);
> }
> }
> {code}
> for example Teiid should have UDF functions like
> {code}
> string random(string)
> string hash(string)
> string digit(string)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years
[JBoss JIRA] (TEIID-4200) Provide support for Wildfly 10
by Kylin Soong (JIRA)
[ https://issues.jboss.org/browse/TEIID-4200?page=com.atlassian.jira.plugin... ]
Kylin Soong commented on TEIID-4200:
------------------------------------
h2. File Architectures change cause Teiid Server start failed.
In current upstream, odata war be packaged in deployments folder, this caused teiid server start failed. Note that, odata war depend on install cli to install teiid subsystem related service, then execute odata war deploy, if packaged these wars in deployments folder in advance will cause the following error
{code}
17:53:27,949 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "teiid-odata.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.undertow.deployment.default-server.default-host./odata.UndertowDeploymentInfoService is missing [jboss.security.security-domain.teiid-security]"]}
17:53:27,951 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "teiid-olingo-odata4.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService is missing [jboss.security.security-domain.teiid-security]"]}
service jboss.deployment.unit."teiid-odata.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata, service jboss.deployment.unit."teiid-odata.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-odata.war".component."org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata, service jboss.deployment.unit."teiid-odata.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-odata.war".component."org.teiid.odata.ODataServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata, service jboss.deployment.unit."teiid-odata.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-odata.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata.UndertowDeploymentInfoService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."org.teiid.olingo.web.ODataFilter".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."org.teiid.olingo.web.ODataServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".component."org.teiid.olingo.web.StaticContentServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./odata4, service jboss.deployment.unit."teiid-olingo-odata4.war".deploymentCompleteService]
service jboss.deployment.unit."teiid-olingo-odata4.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./odata4.UndertowDeploymentInfoService]
{code}
> Provide support for Wildfly 10
> ------------------------------
>
> Key: TEIID-4200
> URL: https://issues.jboss.org/browse/TEIID-4200
> Project: Teiid
> Issue Type: Feature Request
> Components: Server
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Priority: Blocker
> Fix For: 9.1
>
>
> Upgrade the host runtime environment for Teiid Server to be WildFly 10.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years
[JBoss JIRA] (TEIID-4298) Support in Odata4 for the Partner NavigationProperty attribute
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-4298?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-4298.
---------------------------------
Resolution: Done
Added the OData reverse navigation, based on relational table's FK and its reference table
> Support in Odata4 for the Partner NavigationProperty attribute
> --------------------------------------------------------------
>
> Key: TEIID-4298
> URL: https://issues.jboss.org/browse/TEIID-4298
> Project: Teiid
> Issue Type: Enhancement
> Components: OData
> Affects Versions: 9.0
> Reporter: Mirco Marchitiello
> Assignee: Ramesh Reddy
> Fix For: 9.1
>
>
> in Teiid 9.0 it would be useful to create a bidirectional link between tables, like in odata2
> for example:
> <EntityType Name="Product">
> <Key>
> <PropertyRef Name="ProductID"/>
> </Key>
> <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity"/>
> <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40"/>
> <Property Name="SupplierID" Type="Edm.Int32"/>
> <Property Name="CategoryID" Type="Edm.Int32"/>
> <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20"/>
> <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4"/>
> <Property Name="UnitsInStock" Type="Edm.Int16"/>
> <Property Name="UnitsOnOrder" Type="Edm.Int16"/><Property Name="ReorderLevel" Type="Edm.Int16"/>
> <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false"/>
> <NavigationProperty Name="Category" Type="NorthwindModel.Category" Partner="Products">
> <ReferentialConstraint Property="CategoryID" ReferencedProperty="CategoryID"/>
> </NavigationProperty>
> <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Product"/>
> <NavigationProperty Name="Supplier" Type="NorthwindModel.Supplier" Partner="Products">
> <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID"/>
> </NavigationProperty>
> </EntityType>
> <EntityType Name="Category">
> <Key>
> <PropertyRef Name="CategoryID"/>
> </Key>
> <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity"/>
> <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15"/>
> <Property Name="Description" Type="Edm.String" MaxLength="max"/>
> <Property Name="Picture" Type="Edm.Binary" MaxLength="max"/>
> <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Category"/>
> </EntityType>
> It seems that the two tables are related through NavigationProperty and Partner
> In fact I can see all the Categories of a certain Product
> http://services.odata.org/V4/Northwind/Northwind.svc/Products(10)/Category
> or viceversa the products of a certain Category
> http://services.odata.org/V4/Northwind/Northwind.svc/Categories(8)/Products
> While in Teiid using odata2 this works just by creating a FK from one table to the other one, with odata4 this does not happen
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years
[JBoss JIRA] (TEIID-4000) Better handling for large bulk inserts
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4000?page=com.atlassian.jira.plugin... ]
Work on TEIID-4000 started by Steven Hawkins.
---------------------------------------------
> Better handling for large bulk inserts
> --------------------------------------
>
> Key: TEIID-4000
> URL: https://issues.jboss.org/browse/TEIID-4000
> Project: Teiid
> Issue Type: Enhancement
> Components: JDBC Driver, Server
> Affects Versions: 8.7.1.6_2
> Environment: Red Hat JBoss Data Virtualization 6.2 patched to 6.2.2 on EAP6.4.0 patched to version 6.4.3,
> JBoss Developer Studio 8.1.0GA with Teiid Designer plugin 9.0.3.Final.v20150810-1438-B1157
> 64-bit Windows 7 environment
> Reporter: Steve Tran
> Assignee: Steven Hawkins
> Fix For: 9.1
>
>
> I'm running a JDBC batch insert statement with Teiid. Here's the error I'm getting when trying to insert 45000 records.
> {code}
> Exception in thread "main" org.teiid.jdbc.TeiidSQLException: Adjusted frame length exceeds 2097152: 6242128 - discarded
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)
> at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:532)
> at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:393)
> at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:252)
> at com.imshealth.common.Tuning.JdbcDriver.writeData(JdbcDriver.java:166)
> at com.imshealth.common.Tuning.JdbcDriver.main(JdbcDriver.java:78)
> Caused by: org.jboss.netty.handler.codec.frame.TooLongFrameException: Adjusted frame length exceeds 2097152: 6242128 - discarded
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.fail(LengthFieldBasedFrameDecoder.java:417)
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.failIfNecessary(LengthFieldBasedFrameDecoder.java:405)
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:320)
> at org.teiid.transport.ObjectDecoder.decode(ObjectDecoder.java:108)
> at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)
> at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
> at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
> at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
> at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:328)
> at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
> at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> Here's the Java method that creates the batch. Please ignore the lack of Java best practices. This is just test harness code to reproduce the error.
> {code}
> private static final String INSERT_TEIID = "insert into ...<tableA> values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
> private static final String INSERT_ORACLE = "insert into ...<tableA> values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
> private static void writeData(List<List<Object>> records) throws SQLException {
> PreparedStatement ps = connection.prepareStatement(USE_TEIID? INSERT_TEIID : INSERT_ORACLE)
>
> long start = System.currentTimeMillis();
> System.out.println("Building batch PreparedStatement");
> for(List<Object> o : records) {
> ps.setObject(1, o.get(0));
> ps.setObject(2, o.get(1));
> ps.setObject(3, o.get(2));
> ps.setObject(4, o.get(3));
> ps.setObject(5, o.get(4));
> ps.setObject(6, o.get(5));
> ps.setObject(7, o.get(6));
> ps.setObject(8, o.get(7));
> ps.setObject(9, o.get(8));
> ps.setObject(10, o.get(9));
> ps.setObject(11, o.get(10));
> ps.setObject(12, o.get(11));
> ps.setObject(13, o.get(12));
> ps.setObject(14, o.get(13));
> ps.setObject(15, o.get(14));
> ps.setObject(16, o.get(15));
> ps.setObject(17, o.get(16));
> ps.setString(18, o.get(17).toString().replace("]", ""));
> ps.addBatch();
> }
> System.out.println(String.format("Finished building batch PreparedStatement in %d milliseconds", System.currentTimeMillis() - start));
> start = System.currentTimeMillis();
> System.out.println("Executing batch");
> ps.executeBatch();
> System.out.println(String.format("Batch executed in %d milliseconds", System.currentTimeMillis() - start));
> ps.close();
> }
> {code}
> The protocol or the driver should be enhanced to prevent this exception.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years
[JBoss JIRA] (TEIID-4000) Better handling for large bulk inserts
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4000?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4000:
----------------------------------
Priority: Major (was: Minor)
> Better handling for large bulk inserts
> --------------------------------------
>
> Key: TEIID-4000
> URL: https://issues.jboss.org/browse/TEIID-4000
> Project: Teiid
> Issue Type: Enhancement
> Components: JDBC Driver, Server
> Affects Versions: 8.7.1.6_2
> Environment: Red Hat JBoss Data Virtualization 6.2 patched to 6.2.2 on EAP6.4.0 patched to version 6.4.3,
> JBoss Developer Studio 8.1.0GA with Teiid Designer plugin 9.0.3.Final.v20150810-1438-B1157
> 64-bit Windows 7 environment
> Reporter: Steve Tran
> Assignee: Steven Hawkins
> Fix For: 9.1
>
>
> I'm running a JDBC batch insert statement with Teiid. Here's the error I'm getting when trying to insert 45000 records.
> {code}
> Exception in thread "main" org.teiid.jdbc.TeiidSQLException: Adjusted frame length exceeds 2097152: 6242128 - discarded
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)
> at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:532)
> at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:393)
> at org.teiid.jdbc.PreparedStatementImpl.executeBatch(PreparedStatementImpl.java:252)
> at com.imshealth.common.Tuning.JdbcDriver.writeData(JdbcDriver.java:166)
> at com.imshealth.common.Tuning.JdbcDriver.main(JdbcDriver.java:78)
> Caused by: org.jboss.netty.handler.codec.frame.TooLongFrameException: Adjusted frame length exceeds 2097152: 6242128 - discarded
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.fail(LengthFieldBasedFrameDecoder.java:417)
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.failIfNecessary(LengthFieldBasedFrameDecoder.java:405)
> at org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:320)
> at org.teiid.transport.ObjectDecoder.decode(ObjectDecoder.java:108)
> at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)
> at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
> at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
> at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
> at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
> at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:328)
> at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
> at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> Here's the Java method that creates the batch. Please ignore the lack of Java best practices. This is just test harness code to reproduce the error.
> {code}
> private static final String INSERT_TEIID = "insert into ...<tableA> values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
> private static final String INSERT_ORACLE = "insert into ...<tableA> values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
> private static void writeData(List<List<Object>> records) throws SQLException {
> PreparedStatement ps = connection.prepareStatement(USE_TEIID? INSERT_TEIID : INSERT_ORACLE)
>
> long start = System.currentTimeMillis();
> System.out.println("Building batch PreparedStatement");
> for(List<Object> o : records) {
> ps.setObject(1, o.get(0));
> ps.setObject(2, o.get(1));
> ps.setObject(3, o.get(2));
> ps.setObject(4, o.get(3));
> ps.setObject(5, o.get(4));
> ps.setObject(6, o.get(5));
> ps.setObject(7, o.get(6));
> ps.setObject(8, o.get(7));
> ps.setObject(9, o.get(8));
> ps.setObject(10, o.get(9));
> ps.setObject(11, o.get(10));
> ps.setObject(12, o.get(11));
> ps.setObject(13, o.get(12));
> ps.setObject(14, o.get(13));
> ps.setObject(15, o.get(14));
> ps.setObject(16, o.get(15));
> ps.setObject(17, o.get(16));
> ps.setString(18, o.get(17).toString().replace("]", ""));
> ps.addBatch();
> }
> System.out.println(String.format("Finished building batch PreparedStatement in %d milliseconds", System.currentTimeMillis() - start));
> start = System.currentTimeMillis();
> System.out.println("Executing batch");
> ps.executeBatch();
> System.out.println(String.format("Batch executed in %d milliseconds", System.currentTimeMillis() - start));
> ps.close();
> }
> {code}
> The protocol or the driver should be enhanced to prevent this exception.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years