OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to unlock a document not properly closed?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
malcooke
General User
General User


Joined: 06 Jan 2005
Posts: 24

PostPosted: Mon Jan 10, 2005 9:27 am    Post subject: How to unlock a document not properly closed? Reply with quote

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
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Jan 10, 2005 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
malcooke
General User
General User


Joined: 06 Jan 2005
Posts: 24

PostPosted: Mon Jan 10, 2005 1:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Mon Jan 10, 2005 8:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
malcooke
General User
General User


Joined: 06 Jan 2005
Posts: 24

PostPosted: Tue Jan 11, 2005 3:20 am    Post subject: Reply with quote

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
View user's profile Send private message
hawstom
General User
General User


Joined: 21 Dec 2004
Posts: 33
Location: Arizona, USA

PostPosted: Thu Oct 20, 2005 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group