Please let me know if you are sick of me pestering you.
My problem is that when I delete some things from a folder, and then close it using the expunge flag:
[folder object].close(true);
The contents of my folder are corrupted (All of the messages remaining lose all of their content). I can reproduce this every time.
I am using mstor v0.9.6 with the following settings:
p.setProperty("mstor.mbox.useNioMapping", "false");
p.setProperty("mstor.meta.enabled", "false");
Any ideas?
Rusty
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just tried the following test, and it seems to work ok:
URLName url = new URLName("mstor:c:/temp/mstor_test");
Properties p = new Properties();
// disable metadata..
p.setProperty("mstor.meta.enabled", "false");
p.setProperty("mstor.mbox.useNioMapping", "false");
Store store = new MStorStore(Session.getDefaultInstance(p), url);
store.connect();
I've just found a couple of things that could lead to data corruption in a multi-threaded environment (regarding the encoder/decoder and dateformat in the MboxFile). This may be the cause of the problem, but I can't guarantee it..
regards,
ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote some test code (similar to what you have above, but with a folder of 50 or so messages, and more delete operations) and it appears to work fine.
So then I checked my code again, and I found an issue where a thread was being kicked off before another one had finished. This was causing two threads to both trying using mstor at once, possibly even for the same folder. I found one other small issue with the way I was handling messages as well. It looks like one (or both) of these was the cause of my corruption issues...
sorry for the confusion,
Rusty
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No worries. I hope to improve concurrency support in mstor, or at least document where classes are not thread-safe. If you have any suggestions or requests for improving synchronisation let me know.
regards,
ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Ben,
Please let me know if you are sick of me pestering you.
My problem is that when I delete some things from a folder, and then close it using the expunge flag:
[folder object].close(true);
The contents of my folder are corrupted (All of the messages remaining lose all of their content). I can reproduce this every time.
I am using mstor v0.9.6 with the following settings:
p.setProperty("mstor.mbox.useNioMapping", "false");
p.setProperty("mstor.meta.enabled", "false");
Any ideas?
Rusty
Hi Rusty,
I've just tried the following test, and it seems to work ok:
URLName url = new URLName("mstor:c:/temp/mstor_test");
Properties p = new Properties();
// disable metadata..
p.setProperty("mstor.meta.enabled", "false");
p.setProperty("mstor.mbox.useNioMapping", "false");
Store store = new MStorStore(Session.getDefaultInstance(p), url);
store.connect();
Folder inbox = store.getDefaultFolder().getFolder("Inbox");
inbox.open(Folder.READ_WRITE);
Message message = inbox.getMessage(1);
message.setFlag(Flags.Flag.DELETED, true);
inbox.close(true);
Let me know how your code differs from this and I can try to replicate your problem.
regards,
ben
Rusty,
I've just found a couple of things that could lead to data corruption in a multi-threaded environment (regarding the encoder/decoder and dateformat in the MboxFile). This may be the cause of the problem, but I can't guarantee it..
regards,
ben
Hi Ben,
I wrote some test code (similar to what you have above, but with a folder of 50 or so messages, and more delete operations) and it appears to work fine.
So then I checked my code again, and I found an issue where a thread was being kicked off before another one had finished. This was causing two threads to both trying using mstor at once, possibly even for the same folder. I found one other small issue with the way I was handling messages as well. It looks like one (or both) of these was the cause of my corruption issues...
sorry for the confusion,
Rusty
Hi Rusty,
No worries. I hope to improve concurrency support in mstor, or at least document where classes are not thread-safe. If you have any suggestions or requests for improving synchronisation let me know.
regards,
ben