Home » Developer & Programmer » Forms » Unlocking and Deleting a Physical file on a pc
Unlocking and Deleting a Physical file on a pc [message #228691] Tue, 03 April 2007 14:02 Go to next message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
Hi.
DB: Oracle 9i.
Currently using Form 6i for the application client side.

Problem: Some .fmx files are getting corrupted on the client's workstation.

So far, we are able to capture the corrupted file or the missing files. In the case of a missing file, we do nothing. Upon next login, the application will automatically download the missing file from an FTP server.

In the case of a corrupted file, this is where it gets complicated.
When the user attempts to use the corrupted file, they get an error message that we display since as previously stated, we are able to catch when the file is corrupted or missing.

Once the corrupted file causing the problem is caught, we issue a delete on that file so that once the user logs back in, the application will automatically redownload the .fmx and the problem should be fixed.

Roadblock: Somehow, the corrupted .fmx file gets in a "lock" state when the user first attempt to get to it. The process (ifrun60.exe) holds the lock to the file and we cannot delete the file until that process releases the lock.

We know the file delete works as it was tested previously on an "uncorrupted" file.

We need to unlock the file from the process without killing the process. Then we can issue the delete. There are some third party software (i.e Unlocker would be one of them) that would do the trick, but that is not an option for us.

Anybody knows how to unlock a file from a process without killing the process from forms 6i?

Greatly appreciated.



[Updated on: Tue, 03 April 2007 14:02]

Report message to a moderator

Re: Unlocking and Deleting a Physical file on a pc [message #228718 is a reply to message #228691] Tue, 03 April 2007 21:14 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
A fascinating problem.

Perhaps your solution is to avoid the situation altogether.
  1. Stop the forms from being corrupted?
  2. Copy them all down every time?
  3. Why not test all the forms from another form before starting your main application and fix the bad ones?
  4. Why not run the forms from the server?
David
Re: Unlocking and Deleting a Physical file on a pc [message #228777 is a reply to message #228691] Wed, 04 April 2007 03:02 Go to previous messageGo to next message
Flyhard
Messages: 21
Registered: April 2007
Location: Germany
Junior Member
Maybe you could calculate a MD5-Hash for all files, and compare it with a master list before your FTP-Process starts. That way you can identifiy the corrupt files and delete them...
Re: Unlocking and Deleting a Physical file on a pc [message #228911 is a reply to message #228718] Wed, 04 April 2007 09:14 Go to previous messageGo to next message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
djmartin wrote on Tue, 03 April 2007 22:14
A fascinating problem.

Perhaps your solution is to avoid the situation altogether.
  1. Stop the forms from being corrupted? - We are not sure what is actually causing the files to become corrupted. The problem is also intermittant. It happens sporadically on different workstations and it seems to happen during initial pull from the ftp server.
  2. Copy them all down every time? - Unfortunately, that would not fix it for us as per previous answer and the fact that downloading over 160MB of forms and libraries would cause head aches and clog the network. (long download time as well...)
  3. Why not test all the forms from another form before starting your main application and fix the bad ones? - I like the idea, Flyhard seems to be taking the same direction. I will have to look into this further as I do not know how you can check file integrity. (Never done this before)
  4. Why not run the forms from the server? - We do have a web base version, but only for users out of their internal network. We plan on going fully web based, but we're not there yet!
David

Re: Unlocking and Deleting a Physical file on a pc [message #228913 is a reply to message #228777] Wed, 04 April 2007 09:15 Go to previous messageGo to next message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
Is a MD5-Hash the only way to accomplish this or is there any other available options? Just checking what would be the best approach here.

Do you know a good site where I could start looking into how to use MD5-Hash test through Forms?

PS: Thanks all for the help, this is great.
Re: Unlocking and Deleting a Physical file on a pc [message #229728 is a reply to message #228913] Mon, 09 April 2007 21:12 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
By my point 4 - "Why not run the forms from the server?" I meant why not have the fmx and other files run from a networked directory (it must be NT compatiable which means that it can NOT be a real NT server - Linux is good) instead of from each user's PC?

David
Re: Unlocking and Deleting a Physical file on a pc [message #229983 is a reply to message #229728] Tue, 10 April 2007 08:23 Go to previous messageGo to next message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
Unfortunately, we have no power over their network (our clients) nor the server they use. They currently run off of Windows Server 2003. We have access to the server to perform our maintenance, but that's about it. Thanks for the input though.
Re: Unlocking and Deleting a Physical file on a pc [message #231341 is a reply to message #228691] Mon, 16 April 2007 11:03 Go to previous messageGo to next message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
Hi all.
This problem is now fixed. Thanks to all for the replies.
There is a couple of way to accomplish this:

1- During runtime, we were able to catch the corrupted files (.fmx,.plx, etc.) and tell the user to log out and log back into forms.
By doing so you can record the file name and append it to a batch file local to the user's workstation. This batch file would then be ran right before the FTP process would perform the download from the server. (This would happen as soon as the user logs in.) This way, the corrupted file gets deleted and the ftp process picks up the file once again.

2- Same as a above except record corrupted file (.fmx,.plx, etc.) in a text file and use the d2kwutl libary to perform the deletion. (Might be a preferred solution to running a batch file...)

3- *Preferred solution* Let the FTP process repair its own mistake. We have a pattern when we get corrupted files. The size of the corrupted file on the user's local machine is always different from the file in the "Updates" directory of the server we are FTP from. Therefore, we let FTP compare the file size as well as the dates between the user's workstation and the ftp server. If there is a difference, then we overwrite the file. That did it for us!

We didn't opt for the MDHASH5 solution as you would need to maintain a master list everytime you perform and update on your forms and that seemed to be high in maintenance cost.

Hope the above info helps.

Cheers.
Re: Unlocking and Deleting a Physical file on a pc [message #231344 is a reply to message #228691] Mon, 16 April 2007 11:11 Go to previous message
rfilion
Messages: 8
Registered: April 2007
Location: Ottawa
Junior Member
PS: IF anybody ever finds a way to unlock a file from a process without killing the process, then please post, I would still like to know how this can be done.

PS: Would have to be done through Forms either through a "Host()" call or the libraries or anything you can think of that would release that file from the process. That would be great.

i.e There is a call that you can make in a Package that will release the locks of a DLL file --> ora_ffi.unload_library('', '<filename>.dll');

Would be nice to have a generic one that accepts a filename and releases from the holding process.
Previous Topic: Artificial scrollbar
Next Topic: wanna change text item functionality
Goto Forum:
  


Current Time: Thu Dec 08 06:00:56 CST 2016

Total time taken to generate the page: 0.09569 seconds