jankotek/JDBM3 — Issue #17: Error when reading/writing hashmap from two threads
Author: ajermakovics
Created: 2012-02-26 22:37:06+00:00
State: open

In Alpha2 using this code:

```java
public class DbOp implements Runnable
{
private static DB db;
private static String mapName = "map";

public static void main(String[] args) throws InterruptedException
{
db = new DBMaker("db").disableTransactions().disableCache().build();
if( db.getHashMap(mapName) == null ) db.createHashMap(mapName);

Thread thread = new Thread(new DbOp());

thread.start();
new DbOp().run();

thread.join();
db.close();
}

public void run()
{
Map map =db.getHashMap(mapName);

for(int i = 1; i < 10000; i++)
map.put(i, map.get(i-1) + i );
}
}
```

Get an error error: `double get for block 0`