Issue 126131 - Open office process not releasing file lock on temporary files.
Summary: Open office process not releasing file lock on temporary files.
Status: UNCONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: 4.1.1
Hardware: PC Windows 7
: P2 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-25 13:00 UTC by jvchbabu
Modified: 2015-03-13 05:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Lock screenshot (157.25 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-02-25 13:02 UTC, jvchbabu
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jvchbabu 2015-02-25 13:00:32 UTC
We recently upgraded to open office 4.0.1/4.1.1 version(Apache_OpenOffice_incubating_4.1.1_Win_x86_install_en-US.exe).We installed it and and connect to open office 4.1.1 with UNO Java API.
We used to start the open office from commnad prompt by issue the below command.

Our application used to embed image in word report(.doc file) using UNO Java API.
Original image is copied to temporary location and after embedding to word report we used to delete the temporary file from temporary location.
After upgrading open office version from 3.3.0 to 4.0.1/4.1.1. We observed that the open office process is holding lock on these temporary files. The problem started after upgrading open office version from 3.3.0.
 The issue happens in windows environment only.
 The below is the code snippet which we use to embed the images.Open office is holding lock on the file as soon as the below statement is executed.The file is delete-able only after killing the open office process.PFA for screenshot of file deletion.
xBitmapContainer.insertByName("someID", url);


Code Snippet:
********************************************

                        xBitmapContainer = (XNameContainer) UnoRuntime.queryInterface(
                                XNameContainer.class, xMSF.createInstance(
                                "com.sun.star.drawing.BitmapTable"));
                        xImage = (XTextContent) UnoRuntime.queryInterface(
                                XTextContent.class,     xMSF.createInstance(
                                "com.sun.star.text.TextGraphicObject"));
                        XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(
                                XPropertySet.class, xImage);

                   xBitmapContainer.insertByName("someID", url);
                        internalURL = AnyConverter.toString(xBitmapContainer
                                .getByName("someID"));

                        xProps.setPropertyValue("AnchorType",
                                com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH);
                        xProps.setPropertyValue("GraphicURL", internalURL);

                        textCursor.getText().insertTextContent(textCursor, xImage, false);
                                                
                        XGraphic xGraphic = getGraphicFromURL(xRemoteContext.get("8100")==null?xRemoteContext.get("8600"):xRemoteContext.get("8600"), url);

                        xProps.setPropertyValue("Graphic", xGraphic);

                     

                        // remove the helper-entry
             ***           xBitmapContainer.removeByName("someID");
Comment 1 jvchbabu 2015-02-25 13:02:15 UTC
Created attachment 84538 [details]
Lock screenshot

Lock screenshot
Comment 2 oooforum (fr) 2015-02-26 14:51:47 UTC
I don't understand your problem. You shouldn't need to kill the AOO process. Lock file disappears if you close document properly.

First, ask your question on support forum or API mailing list.
Other users can be help you and confirm if you found a bug.
Comment 3 jvchbabu 2015-03-03 05:19:37 UTC
(In reply to oooforum from comment #2)
> I don't understand your problem. You shouldn't need to kill the AOO process.
> Lock file disappears if you close document properly.
> 
> First, ask your question on support forum or API mailing list.
> Other users can be help you and confirm if you found a bug.

 The temporary files usually deletable as soon as processing is finished in Open office 3.3 version. We just upgraded the open office version to 4.1.1 and observed that file delete operation failed as open office process holding the lock.In this case the temporary directory piling up with uncleared files ad occupying server space. It is problem with open office upgrade only. 
Killing open office process release the lock on temporary image files.
Comment 4 jvchbabu 2015-03-09 05:37:11 UTC
This issue is blocking our upgrade to 4.1.1 version of open office.
Due to the below security issues, we are forced to upgrade to 4.1.1 version.
CVE Details:-

CVE-2012-2334 :https://www.openoffice.org/security/cves/CVE-2012-2334.html 

CVE-2012-2149 :https://www.openoffice.org/security/cves/CVE-2012-2149.html

CVE-2012-1149 :https://www.openoffice.org/security/cves/CVE-2012-1149.html


 Please help us to resolve the issue.
Comment 5 jvchbabu 2015-03-13 05:21:39 UTC
We are ready to provide the more details or information to reproduce the issue.
The file is under lock after executing the below statement .
  xBitmapContainer.insertByName("someID", url);
After processing we are removing the someID by the below statement and it should remove the lock but retaining the lock.
xBitmapContainer.removeByName("someID");