mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 06:47:54 +01: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:
parent
a78b53c5aa
commit
08dbb21a39
1 changed files with 3 additions and 1 deletions
|
@ -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>();
|
||||
|
|
Loading…
Add table
Reference in a new issue