orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

ConcurrentModificationException during ODatabasePoolBase.acquire

Open zerovian opened this issue 12 years ago • 6 comments

OrientDB 1.7.9

Happens very rarely, but very bad when it does happens. App is very thread heavy and uses threadlocal to make db connection thread safe, but during the acquire from the OObjectDatabasePool we get a concurrentmodificationexception.

Below is stack.

java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:926) at java.util.HashMap$EntryIterator.next(HashMap.java:966) at java.util.HashMap$EntryIterator.next(HashMap.java:964) at com.orientechnologies.orient.core.entity.OEntityManager.setClassHandler(OEntityManager.java:207) at com.orientechnologies.orient.object.db.OObjectDatabaseTx.init(OObjectDatabaseTx.java:775) at com.orientechnologies.orient.object.db.OObjectDatabaseTxPooled.reuse(OObjectDatabaseTxPooled.java:53) at com.orientechnologies.orient.core.db.ODatabasePoolBase$1.reuseResource(ODatabasePoolBase.java:77) at com.orientechnologies.orient.core.db.ODatabasePoolBase$1.reuseResource(ODatabasePoolBase.java:61) at com.orientechnologies.common.concur.resource.OResourcePool.getResource(OResourcePool.java:69) at com.orientechnologies.common.concur.resource.OReentrantResourcePool.getResource(OReentrantResourcePool.java:63) at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:149) at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:134) at com.orientechnologies.orient.core.db.ODatabasePoolBase.acquire(ODatabasePoolBase.java:119)

zerovian avatar Oct 31 '14 14:10 zerovian

Hi, we will use new pool since 2.0 so it will be fixed automatically.

andrii0lomakin avatar Nov 01 '14 12:11 andrii0lomakin

@laa this is almost done in 2.0. isn't ? if it's just close it

tglman avatar Nov 03 '14 15:11 tglman

Hi, Nope it is not yet. But we are close.

andrii0lomakin avatar Nov 03 '14 19:11 andrii0lomakin

So how do I work around it? I can't upgrade to 2.0 since it isn't released.

zerovian avatar Nov 05 '14 14:11 zerovian

We will release 2.0-M3 at Monday. And will release 2.0 during few weeks.

andrii0lomakin avatar Nov 07 '14 14:11 andrii0lomakin

Fixed in https://github.com/orientechnologies/orientdb/issues/2901

andrii0lomakin avatar Nov 11 '14 05:11 andrii0lomakin