DBZ-7461 Fix getOffsetScn for XStreamAdapter

This commit is contained in:
mfvitale 2024-02-26 17:15:23 +01:00 committed by Fiore Mario Vitale
parent e174eae235
commit ff1f38ae0b
2 changed files with 5 additions and 4 deletions

View File

@ -334,6 +334,7 @@ else if (getScnIndex() != null) {
}
sb.append(", commit_scn=").append(sourceInfo.getCommitScn().toLoggableFormat());
sb.append(", lcr_position=").append(sourceInfo.getLcrPosition());
sb.append("]");

View File

@ -155,16 +155,16 @@ public Scn getOffsetScn(OracleOffsetContext offsetContext) {
String lcrPosition = offsetContext.getLcrPosition();
if (lcrPosition != null) {
startPosition = LcrPosition.valueOf(lcrPosition).getRawPosition();
getScn(startPosition);
return getScn(startPosition);
}
return offsetContext.getScn();
}
private static void getScn(byte[] startPosition) {
private static Scn getScn(byte[] startPosition) {
try {
XStreamUtility.getSCNFromPosition(startPosition);
return new Scn(XStreamUtility.getSCNFromPosition(startPosition).bigIntegerValue());
}
catch (StreamsException e) {
catch (StreamsException | SQLException e) {
throw new RuntimeException(e);
}
}