Browse Source

Another attempt to prevent "serialization failure" during trimming

AT-sleep-until-message
catbref 4 years ago
parent
commit
58ed72058f
  1. 5
      src/main/java/org/qortal/repository/ATRepository.java
  2. 5
      src/main/java/org/qortal/repository/BlockRepository.java
  3. 1
      src/main/java/org/qortal/repository/hsqldb/HSQLDBATRepository.java
  4. 1
      src/main/java/org/qortal/repository/hsqldb/HSQLDBBlockRepository.java

5
src/main/java/org/qortal/repository/ATRepository.java

@ -90,7 +90,10 @@ public interface ATRepository {
/** Returns height of first trimmable AT state. */
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;
/** Hook to allow repository to prepare/cache info for AT state trimming. */

5
src/main/java/org/qortal/repository/BlockRepository.java

@ -146,7 +146,10 @@ public interface BlockRepository {
/** Returns height of first trimmable online accounts signatures. */
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;
/**

1
src/main/java/org/qortal/repository/hsqldb/HSQLDBATRepository.java

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

1
src/main/java/org/qortal/repository/hsqldb/HSQLDBBlockRepository.java

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

Loading…
Cancel
Save