[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Tom Arnold (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Tom Arnold commented on TEIID-3989:
-----------------------------------
Steve,
I'll review those docs.
I attached a new {{TeiidTest2.zip}} and updated the repro steps. It works as expected if I bundle the Teiid JDBC driver and use that, but if I use the Teiid client JBoss module then I get TeiidSQLWarning instead. It seems like there is some difference between those two.
Thanks!
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, TeiidTest2.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but I'm getting {{TeiidSQLWarning}} instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Tom Arnold (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Tom Arnold updated TEIID-3989:
------------------------------
Steps to Reproduce:
Install Teiid server and create application user {{teiid/Teiid-123}}.
Build and deploy attached {{translator-test}} and deploy {{Test-vdb.xml}}. The VDB has two models, the second one has a translator override which causes it to throw a socket exception (and rethrow as {{TranslatorException}}).
Update {{standalone-teiid.xml}} with this datasource:
{code}
<datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true">
<connection-url>jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true</connection-url>
<driver>teiid</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>teiid</user-name>
<password>Teiid-123</password>
</security>
</datasource>
{code}
Build and deploy attached {{TeiidTest2}} web app.
- http://localhost:8080/test/?test=ds - Use bundled JDBC driver and create TeiidDataSource. This works as documented.
- http://localhost:8080/test/?test=driver - Use bundled JDBC driver and DriverManager. This works as documented.
- http://localhost:8080/test/?test=jboss - Use JBoss AS datasource and Teiid client module. This returns TeiidSQLWarninginstead of PartialResultsWarning.
was:
Install Teiid server and create application user {{teiid/Teiid-123}}.
Build and deploy attached {{translator-test}} and deploy {{Test-vdb.xml}}. The VDB has two models, the second one has a translator override which causes it to throw a socket exception (and rethrow as {{TranslatorException}}).
Update {{standalone-teiid.xml}} with this datasource:
{code}
<datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true">
<connection-url>jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true</connection-url>
<driver>teiid</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>teiid</user-name>
<password>Teiid-123</password>
</security>
</datasource>
{code}
Build and deploy attached {{TeiidTest}} web app.
- http://localhost:8080/test/?test=ds - Use bundled JDBC driver and create TeiidDataSource. This works as documented.
- http://localhost:8080/test/?test=driver - Use bundled JDBC driver and DriverManager. This works as documented.
- http://localhost:8080/test/?test=jboss - Use JBoss AS datasource and Teiid client module. This returns TeiidSQLWarninginstead of PartialResultsWarning.
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, TeiidTest2.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Tom Arnold (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Tom Arnold updated TEIID-3989:
------------------------------
Steps to Reproduce:
Install Teiid server and create application user {{teiid/Teiid-123}}.
Build and deploy attached {{translator-test}} and deploy {{Test-vdb.xml}}. The VDB has two models, the second one has a translator override which causes it to throw a socket exception (and rethrow as {{TranslatorException}}).
Update {{standalone-teiid.xml}} with this datasource:
{code}
<datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true">
<connection-url>jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true</connection-url>
<driver>teiid</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>teiid</user-name>
<password>Teiid-123</password>
</security>
</datasource>
{code}
Build and deploy attached {{TeiidTest}} web app.
- http://localhost:8080/test/?test=ds - Use bundled JDBC driver and create TeiidDataSource. This works as documented.
- http://localhost:8080/test/?test=driver - Use bundled JDBC driver and DriverManager. This works as documented.
- http://localhost:8080/test/?test=jboss - Use JBoss AS datasource and Teiid client module. This returns TeiidSQLWarninginstead of PartialResultsWarning.
was:
Install Teiid server and create application user {{teiid/Teiid-123}}.
Build and deploy attached {{translator-test}} and deploy {{Test-vdb.xml}}. The VDB has two models, the second one has a translator override which causes it to throw a socket exception (and rethrow as {{TranslatorException}}).
Update {{standalone-teiid.xml}} with this datasource:
{code}
<datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true">
<connection-url>jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true</connection-url>
<driver>teiid</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>teiid</user-name>
<password>Teiid-123</password>
</security>
</datasource>
{code}
Build and deploy attached {{TeiidTest}} web app. Goto {{http://localhost:8080/TeiidTest-1.0-SNAPSHOT/}} to test it. You should get back an error
{code}
Expected PartialResultsWarning but got class org.teiid.jdbc.TeiidSQLWarning
{code}
There is a {{PartialResultsTest}} in the {{translator-test}} project which does basically the same thing as the webapp except it does a standalone connection. This code works as expected (returns {{PartialResultsWarning}}).
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, TeiidTest2.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Tom Arnold (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Tom Arnold edited comment on TEIID-3989 at 2/22/16 11:30 AM:
-------------------------------------------------------------
*Edit* Whoops, this is wrong. See my comment below...
Any idea why I'm seeing different behavior between a JBoss AS datasource and a standalone driver/datasource connection?
{code:sql}
select count(*) from (
select item_id from test1.items union all
select item_id from test2.items
) x
{code}
{code:java}
Connection conn = ...
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
rs.next();
int count = rs.getInt(1);
Assert.assertEquals(3, count);
SQLWarning warn = ps.getWarnings();
Assert.assertNotNull(warn);
Assert.assertTrue("Expected PartialResultsWarning but got " + warn.getClass(),
warn instanceof PartialResultsWarning);
PartialResultsWarning prWarning = (PartialResultsWarning) warn;
Iterator<String> failed = prWarning.getFailedConnectors().iterator();
while (failed.hasNext()) {
System.out.println(failed.next());
}
{code}
If I get the connection using the DriverManager or by creating a {{TeiidDataSource}} then the code works as documented.
{code:java}
conn = DriverManager.getConnection(
"jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true",
"teiid",
"Teiid-123"
);
{code}
or
{code:java}
TeiidDataSource ds = new TeiidDataSource();
ds.setUser("teiid");
ds.setPassword("Teiid-123");
ds.setServerName("localhost");
ds.setPortNumber(31000);
ds.setDatabaseName("test");
ds.setPartialResultsMode("true");
conn = ds.getConnection();
{code}
With the JBoss AS datasource I get TeiidSQLWarning and the code does not work.
{code:java}
DataSource ds = (DataSource) new InitialContext().lookup("java:/teiidDS");
conn = ds.getConnection();
{code}
was (Author: tom9729):
Any idea why I'm seeing different behavior between a JBoss AS datasource and a standalone driver/datasource connection?
{code:sql}
select count(*) from (
select item_id from test1.items union all
select item_id from test2.items
) x
{code}
{code:java}
Connection conn = ...
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
rs.next();
int count = rs.getInt(1);
Assert.assertEquals(3, count);
SQLWarning warn = ps.getWarnings();
Assert.assertNotNull(warn);
Assert.assertTrue("Expected PartialResultsWarning but got " + warn.getClass(),
warn instanceof PartialResultsWarning);
PartialResultsWarning prWarning = (PartialResultsWarning) warn;
Iterator<String> failed = prWarning.getFailedConnectors().iterator();
while (failed.hasNext()) {
System.out.println(failed.next());
}
{code}
If I get the connection using the DriverManager or by creating a {{TeiidDataSource}} then the code works as documented.
{code:java}
conn = DriverManager.getConnection(
"jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true",
"teiid",
"Teiid-123"
);
{code}
or
{code:java}
TeiidDataSource ds = new TeiidDataSource();
ds.setUser("teiid");
ds.setPassword("Teiid-123");
ds.setServerName("localhost");
ds.setPortNumber(31000);
ds.setDatabaseName("test");
ds.setPartialResultsMode("true");
conn = ds.getConnection();
{code}
With the JBoss AS datasource I get TeiidSQLWarning and the code does not work.
{code:java}
DataSource ds = (DataSource) new InitialContext().lookup("java:/teiidDS");
conn = ds.getConnection();
{code}
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Tom Arnold (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Tom Arnold commented on TEIID-3989:
-----------------------------------
Any idea why I'm seeing different behavior between a JBoss AS datasource and a standalone driver/datasource connection?
{code:sql}
select count(*) from (
select item_id from test1.items union all
select item_id from test2.items
) x
{code}
{code:java}
Connection conn = ...
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
rs.next();
int count = rs.getInt(1);
Assert.assertEquals(3, count);
SQLWarning warn = ps.getWarnings();
Assert.assertNotNull(warn);
Assert.assertTrue("Expected PartialResultsWarning but got " + warn.getClass(),
warn instanceof PartialResultsWarning);
PartialResultsWarning prWarning = (PartialResultsWarning) warn;
Iterator<String> failed = prWarning.getFailedConnectors().iterator();
while (failed.hasNext()) {
System.out.println(failed.next());
}
{code}
If I get the connection using the DriverManager or by creating a {{TeiidDataSource}} then the code works as documented.
{code:java}
conn = DriverManager.getConnection(
"jdbc:teiid:test@mm://localhost:31000;partialResultsMode=true",
"teiid",
"Teiid-123"
);
{code}
or
{code:java}
TeiidDataSource ds = new TeiidDataSource();
ds.setUser("teiid");
ds.setPassword("Teiid-123");
ds.setServerName("localhost");
ds.setPortNumber(31000);
ds.setDatabaseName("test");
ds.setPartialResultsMode("true");
conn = ds.getConnection();
{code}
With the JBoss AS datasource I get TeiidSQLWarning and the code does not work.
{code:java}
DataSource ds = (DataSource) new InitialContext().lookup("java:/teiidDS");
conn = ds.getConnection();
{code}
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Steven Hawkins edited comment on TEIID-3989 at 2/22/16 8:37 AM:
----------------------------------------------------------------
Ramesh that is not the case. In this case the first union branch is delivering a batch that will likely be feed all the way to the client before the exception from the second branch has been added for delivery. Only by actually cursoring through the results and re-checking the warnings (it helps to call clearWarnings after checking them) will the PartialResultsWarning be guaranteed to be seen. The docs to state that partial results should be checked for at the end of the results.
The other caveats are that the partial results warning need not be the head of the warning chain. So I'll make that update as well.
was (Author: shawkins):
Ramesh that is not the case. The documentation unfortunately is not as complete as it should be. The other caveats are that the partial results warning need not be the head of the warning chain, and more importantly it may not be delivered with the initial results. In this case the first union branch is delivering a batch that will likely be feed all the way to the client before the exception from the second branch has been added for delivery. Only by actually cursoring through the results and re-checking the warnings (it helps to call clearWarnings after checking them) will the PartialResultsWarning be guaranteed to be seen. So I'll update the docs with this full accounting.
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (TEIID-3989) PartialResultsWarning not being returned
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3989?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3989:
---------------------------------------
Ramesh that is not the case. The documentation unfortunately is not as complete as it should be. The other caveats are that the partial results warning need not be the head of the warning chain, and more importantly it may not be delivered with the initial results. In this case the first union branch is delivering a batch that will likely be feed all the way to the client before the exception from the second branch has been added for delivery. Only by actually cursoring through the results and re-checking the warnings (it helps to call clearWarnings after checking them) will the PartialResultsWarning be guaranteed to be seen. So I'll update the docs with this full accounting.
> PartialResultsWarning not being returned
> ----------------------------------------
>
> Key: TEIID-3989
> URL: https://issues.jboss.org/browse/TEIID-3989
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.11.3, 9.0
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Attachments: TeiidTest.zip, Test-vdb.xml, translator-test.zip
>
>
> I'm trying to follow the example [here|https://docs.jboss.org/author/display/TEIID/Partial+Results+Mode] to return source failure information to my app. Partial results mode does work, but when used with a JBoss AS datasource (as opposed to standalone) {{TeiidSQLWarning}} is returned instead of the expected {{PartialResultsWarning}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months