mirror of https://github.com/apache/nifi.git
NIFI-8119: properly free database resources when done with the processing of BLOBs
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #4791
This commit is contained in:
parent
d049bca794
commit
f2555f27f1
|
@ -287,12 +287,13 @@ public class JdbcCommon {
|
|||
if (blob != null) {
|
||||
long numChars = blob.length();
|
||||
byte[] buffer = new byte[(int) numChars];
|
||||
InputStream is = blob.getBinaryStream();
|
||||
int index = 0;
|
||||
int c = is.read();
|
||||
while (c >= 0) {
|
||||
buffer[index++] = (byte) c;
|
||||
c = is.read();
|
||||
try (InputStream is = blob.getBinaryStream()) {
|
||||
int index = 0;
|
||||
int c = is.read();
|
||||
while (c >= 0) {
|
||||
buffer[index++] = (byte) c;
|
||||
c = is.read();
|
||||
}
|
||||
}
|
||||
ByteBuffer bb = ByteBuffer.wrap(buffer);
|
||||
rec.put(i - 1, bb);
|
||||
|
|
Loading…
Reference in New Issue