[jcifs] Is a jcfis cause to lock process/service if it is under multi-threading environment?

Michael B Allen ioplex at gmail.com
Wed Jan 14 16:26:10 GMT 2009


On Wed, Jan 14, 2009 at 2:29 AM, Devalekar, Paresh
<Paresh_Devalekar at bmc.com> wrote:
> The above newly created logarchive file is kept on monitoring by my solution
> using jcfis 1.2.7 version.
>
> But two weeks back, this customer service is locked by the user of my
> solution. I go through the code but hardly find any possibilities by which
> it causes to lock that service/process. When browse with google for problems
> with jcfis, I observed that many have problems with multi-threading
> environment and I think my customer too have same.

What was the error? Was it "The file is being accessed by another process"?

By default the "shareAccess" used by JCIFS is:

  FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE

which indicates that any other process can read, write or delete files
opened by JCIFS.

However, you can changed the shareAccess parameter to SmbFile,
SmbRandomAccessFile or SmbFileOutputStream which could result in the
"The file is being accessed by another process" error if the file is
not closed. Both SmbRandomAccessFile and SmbFileOutputStream provide
close() methods.

If you are not using the shareAccess parameter, then I do not think
the "The file is being accessed by another process" should occur.

What user is JCIFS running under? Perhaps there are different lock
semantics if you are running as Backup Operator? Just guessing here.

> Can anybody focus on this? Is a jcfis cause to lock process/service if it is
> under multi-threading state?

Unless your problem is not the issue described above, it has nothing
to do with multi-threading.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list