forked from Qortal/qortal
Add callstack when logging slow repository queries. Blockchain.validate() improvement
This commit is contained in:
parent
939ce0d652
commit
339e757d34
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user