Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

TRAFODION-2724 #1216

Merged
merged 3 commits into from Sep 4, 2017
Merged

TRAFODION-2724 #1216

merged 3 commits into from Sep 4, 2017

Conversation

sandhyasun
Copy link
Contributor

Fix to ensure internal statements used to retrieve LOB descriptor chunks information during an extract are closed properly. The issue was if the the caller of extract passed in the exact length, the ""readCursorData method would return the correct data but would leave the "open" to the internal table in a FETCH state. This change ensures that a second "fetch" is done so EOD would be seen and as a result the internal statement would get closed within the method ExLob::fethCursor which would call SQL_EXEC_LOBcliInterface(handleIn, handleLenIn, ....
LOB_CLI_SELECT_CLOSE, .....)

Sandhya Sundaresan added 2 commits August 22, 2017 17:38
…t operation is done and the exact length of data is passed in to be extracted.
@Traf-Jenkins
Copy link

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-release2.2/5/

@Traf-Jenkins
Copy link

if (operLen == tgtSize)
{
//The cursor still has data available but wait until redrive since
//we have fetched all the data for this extract operation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment seems to be confusing. What is being waited to do until re-driven?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cursor on the full lob data indicates that there is data left. But the extract operation can retrieve justt a portion of the total. The state is maintained in the cursor and will get updated with each "execute" of the extract statement issued by caller of the extract statement. Agree this comment is confusing. I can just say "return the data to caller".

@sandhyasun
Copy link
Contributor Author

Let me rework this a bit so it is explicitly clear as to where we are closing the internal cursor on the descriptor table. Will make it more readable and easier to maintain. Please don't merge yet.

Added a method for JDBC driver to be able to close an open cursor abruptly by passing in a 0 length to the extract syntax. This will ensure internal opens are not left around if the application does not retrieve all the data with the stream API.
This abrupt close can be called when the result set is closed or the connection is closed by keeping track of all the open Blob objects. (in the driver)
Added a freeResources method and destructor to LobExtract and LobUpdate Tcbs.
Minor changes and fixes :
Refactored the ExLob::closeCursor
Removed the LOB_CLI_SELECT_CLOSE call from ::fetchCursor so it gets closed only when ExLob::closeCursor is called. Makes the code consistent and readable.
Took care of a few  memory allocations and deletions.
Refactored the LOB length calculation into on ecommon method  so it works correctly for both regular LOB dat aas well as external LOB files. Earlier the external lobs length was being returned incorrectly. Now it reports the length of the external HDFS file .
Fixed one place in generator where the CQD value was not being multiplied by the MB units correctly.
@Traf-Jenkins
Copy link

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-release2.2/6/

@Traf-Jenkins
Copy link

@anoopsharma00
Copy link
Contributor

+1

@asfgit asfgit merged commit f186448 into apache:release2.2 Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants