| View previous topic :: View next topic |
| Author |
Message |
malcooke General User

Joined: 06 Jan 2005 Posts: 24
|
Posted: Mon Jan 10, 2005 9:27 am Post subject: How to unlock a document not properly closed? |
|
|
Hi,
I'm using java to provide a print utility for my OOo documents. However whilst testing this there have been occasions where my code has crashed out before its actually reached the close() function.
This then leaves my original document 'locked', and I can no longer recreate the document programmatically without restarting NT. (Opening in OOo opens it up in read only mode).
What I want is a bit of java code that I can call to effectively remove the lock and allow my code to recreate the document. I've looked at the API but can't see anything obvious.
Can anyone point me in the right direction?
Thanks in advance. |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Mon Jan 10, 2005 11:30 am Post subject: |
|
|
One of two things are happening. I believe that OOo is probably locking the file. If you kill OOo completely and then restart, does this fix the problem. If so, then there is a process that is still holding the file handle open.
If this is not the case, perhaps there is a lock file and you just need to delete it. Just a guess. _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
malcooke General User

Joined: 06 Jan 2005 Posts: 24
|
Posted: Mon Jan 10, 2005 1:41 pm Post subject: |
|
|
Thanks for the response.
KIlling OOo completely does not remove the lock on the file. (Unless there is some process other than soffice which has the lock).
The only way I've found to remove it so far is to completely restart WinNT.
Do you have any ideas where a lock file might be placed? or even what kind of name it might have? |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Mon Jan 10, 2005 8:24 pm Post subject: |
|
|
Usually, that means that OOo crashed and there is still a thread or process running that is still holding the file open with the OS. I recommend that you use CTRL+ALT+DEL to open the task manager and then inspect the running processes and the running threads. Well, first, kill the quick starter and see if that helps.
I expect that you can also NOT rename the file manually.... _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
malcooke General User

Joined: 06 Jan 2005 Posts: 24
|
Posted: Tue Jan 11, 2005 3:20 am Post subject: |
|
|
Usually it's just my java code that has crashed - Usually I've loaded the component, updated all th eindexes and then crashed prior to storing the changed document back.
OOo still appears to be working fine and I can open the document from OOo (read-only mode tho), and yes you are right I cannot rename, delete or move the file manually . Next time it happens I will open the task manager and see what is running. |
|
| Back to top |
|
 |
hawstom General User


Joined: 21 Dec 2004 Posts: 33 Location: Arizona, USA
|
Posted: Thu Oct 20, 2005 7:54 pm Post subject: |
|
|
I was working with files in a folder and when I closed them all I couldn't rename the folder. I had to exit the quick starter to release the file lock.
Tom _________________ Tom Haws
Find me at Google
Find peace in sacrificial love |
|
| Back to top |
|
 |
|