EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Concurent access

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#3672
Posted: 09/01/2007 08:38:43
by Andrej Lippai (Basic support level)
Joined: 09/01/2007
Posts: 3

I have a process which constantly performs write operations to storage and the second one which is readonly and performs only reads. I get "The process cannot access the file <storage> because it is being used by another process" error.
I thought that concurent access of one writer and many readers is permited. Is it?
#3674
Posted: 09/01/2007 13:08:04
by Volodymyr Zinin (EldoS Corp.)

Could you please give us more information about the problem:
- what version of SolFS you used (driver or standard edition)?
- please specify the source code which was cause of the error.
#3675
Posted: 09/02/2007 03:11:35
by Eugene Mayevski (EldoS Corp.)

With Standard edition multiprocess access is not possible for writing.
You need to use Driver edition for this.


Sincerely yours
Eugene Mayevski
#3676
Posted: 09/02/2007 03:20:18
by Andrej Lippai (Basic support level)
Joined: 09/01/2007
Posts: 3

I'm using evaluation standard version 3.1.80.
I have one writer and many reader processes.

In this example writer process is calling Write every 100ms with new file. When reader process tryes to call Read method I get "The process cannot access the file <storage> because it is being used by another process" exception in line storage.Open(StorageOpenMode.somOpenExisting)
SolFSExplorer opens end exports files from this "used" storage without problems.


Writer code:
private SolFSStorage _storage;
private void Write(string fileName)
{
if (_storage == null)
{
_storage = new SolFSStorage();
_storage.FileName = storageName;
_storage.CaseSensitive = false;
_storage.Compression = SolFSCompression.crNoCompression;
_storage.FilesEncryption = SolFSEncryption.ecNoEncryption;
_storage.StorageEncryption = SolFSEncryption.ecNoEncryption;
_storage.Logo = "test";
_storage.UseTransactions = true;
_storage.PageSize = 512;
}
if (!_storage.Active)
_storage.Open(StorageOpenMode.somOpenAlways);

SolFSStream stream = new SolFSStream(_storage, Path.GetFileName(fileName), FileMode.Create, FileAccess.ReadWrite);
byte[] data = System.IO.File.ReadAllBytes(fileName);
stream.Write(data, 0, data.Length);
stream.Close();
}

Reader code:
private byte[] Read(string fileName)
{
SolFSStorage storage = new SolFSStorage();
storage.FileName = storageName;
storage.UseTransactions = false;
storage.ReadOnly = true;
storage.Open(StorageOpenMode.somOpenExisting);
SolFSStream stream = new SolFSStream(storage, fileName, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(stream);
byte[] data = reader.ReadBytes((int)stream.Length);
reader.Close();
stream.Close();
storage.Close();
return data;
}
#3677
Posted: 09/02/2007 04:53:47
by Andrej Lippai (Basic support level)
Joined: 09/01/2007
Posts: 3

So one writer and many readers is not possible?
#3678
Posted: 09/02/2007 08:36:00
by Eugene Mayevski (EldoS Corp.)

Use Driver Edition.


Sincerely yours
Eugene Mayevski
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 4372 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!