ARTEMIS-2414 Sync before closing file in case data loss
This commit is contained in:
parent
1eaf12b8e1
commit
dd62be1602
|
@ -361,6 +361,8 @@ final class MappedSequentialFile implements SequentialFile {
|
|||
@Override
|
||||
public void close(boolean waitOnSync) {
|
||||
if (this.mappedFile != null) {
|
||||
if (factory.isDatasync())
|
||||
this.mappedFile.force();
|
||||
this.mappedFile.close();
|
||||
this.mappedFile = null;
|
||||
}
|
||||
|
|
|
@ -135,6 +135,8 @@ public class NIOSequentialFile extends AbstractSequentialFile {
|
|||
|
||||
try {
|
||||
if (channel != null) {
|
||||
if (factory.isDatasync())
|
||||
channel.force(false);
|
||||
channel.close();
|
||||
}
|
||||
} catch (ClosedChannelException e) {
|
||||
|
|
Loading…
Reference in New Issue