You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by xwq <gi...@git.apache.org> on 2017/09/20 05:55:07 UTC
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
GitHub user xwq opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1240
[TRAFODION-2740]JDBC extract LOB context in chunks
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/xwq/incubator-trafodion lob_extract_chunks
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1240.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1240
----
----
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140414892
--- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Lob.java ---
@@ -91,23 +92,49 @@ public void read() throws SQLException {
}
T4Connection t4connection = this.connection_.getServerHandle().getT4Connection();
- LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_BUFFER, lobHandle_, 1, 0,
+ LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_LEN, lobHandle_, 1, 0,
connection_.ic_);
LogicalByteArray rbuffer = t4connection.getReadBuffer(TRANSPORT.SRVR_API_EXTRACTLOB, wbuffer);
ExtractLobReply reply = new ExtractLobReply(rbuffer, connection_.ic_);
- data_ = reply.lobDataValue;
+ length = reply.lobLength;
--- End diff --
Is this length the entire length of the lob returned by the SQL layer ?
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140421411
--- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Lob.java ---
@@ -91,23 +92,49 @@ public void read() throws SQLException {
}
T4Connection t4connection = this.connection_.getServerHandle().getT4Connection();
- LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_BUFFER, lobHandle_, 1, 0,
+ LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_LEN, lobHandle_, 1, 0,
connection_.ic_);
LogicalByteArray rbuffer = t4connection.getReadBuffer(TRANSPORT.SRVR_API_EXTRACTLOB, wbuffer);
ExtractLobReply reply = new ExtractLobReply(rbuffer, connection_.ic_);
- data_ = reply.lobDataValue;
+ length = reply.lobLength;
--- End diff --
I have talked it with Selva. I think the logic is a little complex to support some APIs like setBytes(). I will add write down the design to discuss with you about the next phase.
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140415845
--- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Lob.java ---
@@ -91,23 +92,49 @@ public void read() throws SQLException {
}
T4Connection t4connection = this.connection_.getServerHandle().getT4Connection();
- LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_BUFFER, lobHandle_, 1, 0,
+ LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_LEN, lobHandle_, 1, 0,
connection_.ic_);
LogicalByteArray rbuffer = t4connection.getReadBuffer(TRANSPORT.SRVR_API_EXTRACTLOB, wbuffer);
ExtractLobReply reply = new ExtractLobReply(rbuffer, connection_.ic_);
- data_ = reply.lobDataValue;
+ length = reply.lobLength;
--- End diff --
Yes, it the entire length of the LOB.
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-trafodion/pull/1240
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by arvind-narain <gi...@git.apache.org>.
Github user arvind-narain commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140335560
--- Diff: dcs/src/test/jdbc_test/src/test/java/org/trafodion/jdbc_test/TestForeignKey.java ---
@@ -74,12 +74,15 @@
public static void doTestSuiteSetup() throws Exception {
try{
_conn = DriverManager.getConnection(Utils.url, Utils.usr, Utils.pwd);
- Statement stmt = _conn.createStatement();
-
- stmt.execute(strCreatePKTABLE1Query);
- stmt.execute(strCreatePKTABLE2Query);
- stmt.execute(strCreateFKTABLE1Query);
- stmt.execute(strCreateFKTABLE2Query);
+ try (
--- End diff --
Thanks for the change Weiqing. Learnt something new related to try-with-resource-statement from your change - it does reduce the earlier code change planned - thanks.
Could you please also take care of replacing DriverMagager.getConnection calls from *Blob*, *Clob*, TestGetIndexInfo and this file ? This would take care random non-existent schema errors seen.
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140414625
--- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp ---
@@ -6411,8 +6412,34 @@ odbc_SQLSrvr_ExtractLob_sme_(
exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_;
exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_UNABLE_TO_ALLOCATE_SQL_STMT;
}
+FILE * fp= NULL;
+ fp = fopen("/tmp/closeLOB", "a+");
--- End diff --
What is this /tmp/closeLOB used for ?
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140424965
--- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Lob.java ---
@@ -91,23 +92,49 @@ public void read() throws SQLException {
}
T4Connection t4connection = this.connection_.getServerHandle().getT4Connection();
- LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_BUFFER, lobHandle_, 1, 0,
+ LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_LEN, lobHandle_, 1, 0,
connection_.ic_);
LogicalByteArray rbuffer = t4connection.getReadBuffer(TRANSPORT.SRVR_API_EXTRACTLOB, wbuffer);
ExtractLobReply reply = new ExtractLobReply(rbuffer, connection_.ic_);
- data_ = reply.lobDataValue;
+ length = reply.lobLength;
--- End diff --
ok
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140421177
--- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp ---
@@ -6411,8 +6412,34 @@ odbc_SQLSrvr_ExtractLob_sme_(
exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_;
exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_UNABLE_TO_ALLOCATE_SQL_STMT;
}
+FILE * fp= NULL;
+ fp = fopen("/tmp/closeLOB", "a+");
--- End diff --
Sorry , I will remove them. debug code.
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140568181
--- Diff: dcs/src/test/jdbc_test/src/test/java/org/trafodion/jdbc_test/TestForeignKey.java ---
@@ -74,12 +74,15 @@
public static void doTestSuiteSetup() throws Exception {
try{
_conn = DriverManager.getConnection(Utils.url, Utils.usr, Utils.pwd);
- Statement stmt = _conn.createStatement();
-
- stmt.execute(strCreatePKTABLE1Query);
- stmt.execute(strCreatePKTABLE2Query);
- stmt.execute(strCreateFKTABLE1Query);
- stmt.execute(strCreateFKTABLE2Query);
+ try (
--- End diff --
I see you did a new commit to fix some review comments. Can you also fix this one ? This fix is needed for the daily builds to pass. We often get "non existent schema " errrors with JDBC tests.
---
[GitHub] incubator-trafodion pull request #1240: [TRAFODION-2740]JDBC extract LOB con...
Posted by sandhyasun <gi...@git.apache.org>.
Github user sandhyasun commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1240#discussion_r140416054
--- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Lob.java ---
@@ -91,23 +92,49 @@ public void read() throws SQLException {
}
T4Connection t4connection = this.connection_.getServerHandle().getT4Connection();
- LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_BUFFER, lobHandle_, 1, 0,
+ LogicalByteArray wbuffer = ExtractLobMessage.marshal(ExtractLobMessage.LOB_EXTRACT_LEN, lobHandle_, 1, 0,
connection_.ic_);
LogicalByteArray rbuffer = t4connection.getReadBuffer(TRANSPORT.SRVR_API_EXTRACTLOB, wbuffer);
ExtractLobReply reply = new ExtractLobReply(rbuffer, connection_.ic_);
- data_ = reply.lobDataValue;
+ length = reply.lobLength;
--- End diff --
Ok that may be very large. I thought we're supposed to return each chunk to application to consume ? Will you implement that at next phase ?
---