[teiid-issues] [JBoss JIRA] (TEIID-5213) Required Restful to be able to set/update CLOB value.

Steven Hawkins (JIRA) issues at jboss.org
Tue Jan 16 16:08:00 EST 2018


    [ https://issues.jboss.org/browse/TEIID-5213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13517739#comment-13517739 ] 

Steven Hawkins edited comment on TEIID-5213 at 1/16/18 4:07 PM:
----------------------------------------------------------------

Actually this is addressed TEIID-5069.  I'll add a unit test specific to this case on master.


was (Author: shawkins):
Even on master there still seems to be an issue.  There is a read pending exception that is thrown instead.

> Required Restful to be able to set/update CLOB value.
> -----------------------------------------------------
>
>                 Key: TEIID-5213
>                 URL: https://issues.jboss.org/browse/TEIID-5213
>             Project: Teiid
>          Issue Type: Bug
>          Components: OData
>    Affects Versions: 8.12
>         Environment: JDV 6.3.8
>            Reporter: xu zhang
>            Assignee: Steven Hawkins
>
> In a table of MySql, if a column's type is *TEXT*, it is impossible to use restful way to set/update this column.
> The code like:
> {code}
> public void doTest() throws Exception {
> 		HttpClient httpClient = new HttpClient();
> 		httpClient.start();
> 		URI uri = new URI("http://localhost:8080/odata4/Test/test/");
> 		String realm = "yourdomain.com";
> 		String user = "teiidUser";
> 		String pass = "Redhat!23";
> 		// Add authentication credentials
> 		AuthenticationStore auth = httpClient.getAuthenticationStore();
> 		auth.addAuthentication(new BasicAuthentication(uri, realm, user, pass));
> 		ContentResponse response = httpClient.GET(uri.toString() + "$metadata");
> 		System.out.println(response.getContentAsString());
> 		response = httpClient.GET(uri.toString() + "test_tbl");
> 		System.out.println(response.getContentAsString());
> 		
> 		String jsonPayload = 
> 			"{\"title\":\"title 2\",\"author\":\"author 2\", \"price\":567890.01, \"submission_date\":\"2018-01-05\"}";
> 		response = httpClient.newRequest(uri.toString() + "test_tbl")
>                 .method("POST")
>                 .content(new StringContentProvider(jsonPayload))
>                 .header("Content-Type", "application/json")
>                 .header("Prefer", "return=representation")
>                 .send();
> 		System.out.println(response.getContentAsString());
> 		response = httpClient.newRequest(uri.toString() + "test_tbl(2)/memo")
> 		       .method("PUT")
> 		       .content(new StringContentProvider("this is clob test 2"))
> 		       .send();
> 		System.out.println(response.getContentAsString());
> 		
> 	}
> {code}
> Error shows:
> {code}
> 11:19:06,442 WARN  [org.teiid.CONNECTOR] (Worker0_QueryProcessorQueue2) Connector worker process failed for atomic-request=zlEfhij2vSNv.0.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11013:TEIID11004 Error executing statement(s): [Prepared Values: ['org.teiid.core.types.ClobImpl at 6a52c49c'] SQL: UPDATE "test_tbl" SET "memo" = ? WHERE "test_tbl"."id" = 2]
> 	at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:293) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:401)
> 	at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
> 	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
> 	at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> 	at com.sun.proxy.$Proxy82.execute(Unknown Source)
> 	at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
> 	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> 	at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]
> 	at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> 	at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
> 	at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> 	at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
> 	at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
> Caused by: java.sql.SQLException: java.io.IOException: JBWEB000059: Stream closed
> 	at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:171) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.core.types.ClobType.getSubString(ClobType.java:77) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at com.mysql.jdbc.PreparedStatement.setClob(PreparedStatement.java:3529)
> 	at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4098)
> 	at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3981)
> 	at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:957)
> 	at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:965) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:262) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	... 20 more
> Caused by: java.io.IOException: JBWEB000059: Stream closed
> 	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:391)
> 	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
> 	at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:385) [rt.jar:1.8.0_151]
> 	at org.teiid.core.util.InputStreamReader.read(InputStreamReader.java:80) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.core.util.ObjectConverterUtil.write(ObjectConverterUtil.java:159) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.core.util.ObjectConverterUtil.convertToCharArray(ObjectConverterUtil.java:316) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:166) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> 	... 28 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list