Another attempt to prevent "serialization failure" during trimming

This commit is contained in:
catbref 2020-11-05 14:36:14 +00:00
parent 253a994438
commit 58ed72058f
4 changed files with 10 additions and 2 deletions

View File

@ -90,7 +90,10 @@ public interface ATRepository {
/** Returns height of first trimmable AT state. */ /** Returns height of first trimmable AT state. */
public int getAtTrimHeight() throws DataException; public int getAtTrimHeight() throws DataException;
/** Sets new base height for AT state trimming. */ /** Sets new base height for AT state trimming.
* <p>
* NOTE: performs implicit <tt>repository.saveChanges()</tt>.
*/
public void setAtTrimHeight(int trimHeight) throws DataException; public void setAtTrimHeight(int trimHeight) throws DataException;
/** Hook to allow repository to prepare/cache info for AT state trimming. */ /** Hook to allow repository to prepare/cache info for AT state trimming. */

View File

@ -146,7 +146,10 @@ public interface BlockRepository {
/** Returns height of first trimmable online accounts signatures. */ /** Returns height of first trimmable online accounts signatures. */
public int getOnlineAccountsSignaturesTrimHeight() throws DataException; public int getOnlineAccountsSignaturesTrimHeight() throws DataException;
/** Sets new base height for trimming online accounts signatures. */ /** Sets new base height for trimming online accounts signatures.
* <p>
* NOTE: performs implicit <tt>repository.saveChanges()</tt>.
*/
public void setOnlineAccountsSignaturesTrimHeight(int trimHeight) throws DataException; public void setOnlineAccountsSignaturesTrimHeight(int trimHeight) throws DataException;
/** /**

View File

@ -425,6 +425,7 @@ public class HSQLDBATRepository implements ATRepository {
try { try {
this.repository.executeCheckedUpdate(updateSql, trimHeight); this.repository.executeCheckedUpdate(updateSql, trimHeight);
this.repository.saveChanges();
} catch (SQLException e) { } catch (SQLException e) {
repository.examineException(e); repository.examineException(e);
throw new DataException("Unable to set AT state trim height in repository", e); throw new DataException("Unable to set AT state trim height in repository", e);

View File

@ -484,6 +484,7 @@ public class HSQLDBBlockRepository implements BlockRepository {
try { try {
this.repository.executeCheckedUpdate(updateSql, trimHeight); this.repository.executeCheckedUpdate(updateSql, trimHeight);
this.repository.saveChanges();
} catch (SQLException e) { } catch (SQLException e) {
repository.examineException(e); repository.examineException(e);
throw new DataException("Unable to set online accounts signatures trim height in repository", e); throw new DataException("Unable to set online accounts signatures trim height in repository", e);