Skip to content

Commit

Permalink
WFLY-10392 Regression in Remote JCA scenario with JDBC store after Ar…
Browse files Browse the repository at this point in the history
…temis upgrade

Reverted ac9af4f
  • Loading branch information
franz1981 committed May 17, 2018
1 parent 38600b5 commit 581e49f
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,27 +294,17 @@ public int readFromFile(JDBCSequentialFile file, ByteBuffer bytes) throws SQLExc
if (rs.next()) {
final Blob blob = rs.getBlob(1);
if (blob != null) {
final long blobLength = blob.length();
final int bytesRemaining = bytes.remaining();
final long filePosition = file.position();
readLength = (int) calculateReadLength(blobLength, bytesRemaining, filePosition);
if (logger.isDebugEnabled()) {
logger.debugf("trying read %d bytes: blobLength = %d bytesRemaining = %d filePosition = %d",
readLength, blobLength, bytesRemaining, filePosition);
}
if (readLength < 0) {
readLength = -1;
} else if (readLength > 0) {
byte[] data = blob.getBytes(file.position() + 1, readLength);
bytes.put(data);
}
readLength = (int) calculateReadLength(blob.length(), bytes.remaining(), file.position());
byte[] data = blob.getBytes(file.position() + 1, readLength);
bytes.put(data);
}
}
connection.commit();
return readLength;
} catch (SQLException e) {
connection.rollback();
} catch (Throwable e) {
throw e;
} finally {
connection.rollback();
}
}
}
Expand Down

0 comments on commit 581e49f

Please sign in to comment.