Queue in read-only mode

27 views
Skip to first unread message

Jure Kajzer

unread,
Jan 5, 2018, 4:14:52 AM1/5/18
to MapDB
 I have a use case on 1.0.7 where i use a Queue backed by a file DB to cache some operation parameters but at a point in time i close that DB and move on to next DB (sequential naming). 

In a different process i open the previously closed DB to consume the rest of the queue. At this point no changes (additions) to the queue will be made and after the queue is handled the DB will be deleted.

So the question: is it possible to open DB in read only mode and access the records of the queue. Normal iteration will not work as it uses remove on queue which changes it and results in a unsupported exception because of read only.

If anyone has a different idea ... other than have a map with sequence as the key, as i'm trying to avoid that.

LP, jure
Reply all
Reply to author
Forward
0 new messages