Multithreading with one JDBMRecordManager

  • Z.G.

    Z.G. - 2001-07-25

    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 are not enough synchronized. For example, you can add or remove caches while updating with an object.

    I synchronized all theses methods in 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)

    • Alex Boisvert

      Alex Boisvert - 2001-07-25

      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.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks