0

I tested JDBM2 which is really a great API to persist data directly in a tree- or hash-map. On the project site it is written that it does not support concurrent access. So my question is: Are there similar open source APIs for Java available which support concurrent read and write operations?

Thanks

Miguel Ping
  • 18,082
  • 23
  • 88
  • 136
Michael
  • 4,722
  • 6
  • 37
  • 58

2 Answers2

1

I guess a basic feature the questions implies is inter-jvm communication? If that is the case, I have successfully used hazelcast.

See for example this question that although different has valuable information.

Community
  • 1
  • 1
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
0

Java has a way of wrapping an existent hash map and returning a synchronized map; however you will have to write the synchronization yourself: Collections#synchronizedMap

It is quite easy to extend an HashMap or implement the Map interface to enforce some synchronization on get() and put(), however iterators are more tricky.

There's also a ConcurrentHashMap but it has some limitations, depending on what you want to do.

The simple approach is to use Collections#synchronizedMap and add the synchronization code yourself.

Miguel Ping
  • 18,082
  • 23
  • 88
  • 136