I tried to use jdbm with one JDBMRecordManager and multiple hashtables. I had a lot of different exception (bad FD, double get while put in hashtable, ArrayIndexOutOfBoundsException in jdbm.recman.TransactionManager.start, etc). Nearly all exception occured while passing through jdbm.recman.RecordManager.commit.
It seems to me that the methods in RecordManager.java are not enough synchronized. For example, you can add or remove caches while updating with an object.
I synchronized all theses methods in RecordManager.java and no I don't have exception anymore:
public void update(long recid, Object obj)
public void commit()
public void rollback()
public long getNamedObject(String name)
public void setNamedObject(String name, long recid)
public void addCache(RecordCache cache)
public void removeCache(RecordCache cache)
For of all, thanks for the pointing this out.
I will investigate thread-safeness within JDBM and synchronize the method necessary to have correct behavior when accessing the objects from multiple threads.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.