3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 23:32:16 +00:00

H2 store: Set a 60 second locking timeout to avoid failures when processing large/complex operations.

Resolves issue 348.
This commit is contained in:
Mike Hearn 2013-03-29 18:00:46 +00:00
parent a78b53c5aa
commit 08dbb21a39

View File

@ -99,7 +99,9 @@ public class H2FullPrunedBlockStore implements FullPrunedBlockStore {
public H2FullPrunedBlockStore(NetworkParameters params, String dbName, int fullStoreDepth) throws BlockStoreException {
this.params = params;
this.fullStoreDepth = fullStoreDepth;
connectionURL = "jdbc:h2:" + dbName + ";create=true";
// We choose a very lax timeout to avoid the database throwing exceptions on complex operations, as time is not
// a particularly precious resource when just keeping up with the chain.
connectionURL = "jdbc:h2:" + dbName + ";create=true;LOCK_TIMEOUT=60000";
conn = new ThreadLocal<Connection>();
allConnections = new LinkedList<Connection>();