Add callstack when logging slow repository queries. Blockchain.validate() improvement

This commit is contained in:
catbref 2019-11-26 11:31:44 +00:00
parent 939ce0d652
commit 339e757d34
2 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,6 @@ import org.eclipse.persistence.exceptions.XMLMarshalException;
import org.eclipse.persistence.jaxb.JAXBContextFactory;
import org.eclipse.persistence.jaxb.UnmarshallerProperties;
import org.qora.controller.Controller;
import org.qora.controller.Synchronizer.SynchronizationResult;
import org.qora.data.block.BlockData;
import org.qora.network.Network;
import org.qora.repository.BlockRepository;
@ -487,6 +486,9 @@ public class BlockChain {
BlockData parentBlockData = parentBlock.getBlockData();
while (true) {
// No need to maintain transaction state while ploughing through the entire chain
repository.discardChanges();
BlockData childBlockData = parentBlock.getChild();
if (childBlockData == null)
break;

View File

@ -394,7 +394,7 @@ public class HSQLDBRepository implements Repository {
long queryTime = System.currentTimeMillis() - beforeQuery;
if (this.slowQueryThreshold != null && queryTime > this.slowQueryThreshold) {
LOGGER.info(String.format("HSQLDB query took %d ms: %s", queryTime, sql));
LOGGER.info(String.format("HSQLDB query took %d ms: %s", queryTime, sql), new SQLException("slow query"));
logStatements();
}