Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT holding on to generated documents
PKofon
In my application, I've implemented a listener that ensures that users' temporary files (documents and images generated when they run reports) get deleted automatically once their session is invalidated; e.g. when their sessions time out or when they explicitly log out of the application. However, only the image files get deleted whenever this happens. The document (*.rptdocument) files don't get deleted even though there's nothing wrong with my implementation. Trying to delete them manually generates an error that says the files are currently being used by another process.
All the temporary files (for every user) get deleted when the server is shutting down. This works as expected, only because the files are deleted after a call to IReportEngine.destroy() and Platform.shutdown().
While the server is running, is there a way to ensure that BIRT doesn't hold on to the documents so they can be deleted as needed? Note that after rendering the reports, the render task is closed appropriately, so this isn't the issue. Besides, calling IReportDocument.close() on the document doesn't help either. Am I missing something?
Find more posts tagged with
Comments
johnw
Are you executing an IRunAndRenderTask.close(), IRunTask.close() or a IRenderTask.close in your application?
PKofon
<blockquote class='ipsBlockquote' data-author="'johnw'" data-cid="69455" data-time="1287401889" data-date="18 October 2010 - 04:38 AM"><p>
Are you executing an IRunAndRenderTask.close(), IRunTask.close() or a IRenderTask.close in your application?<br /></p></blockquote>
<br />
Yes, as I said, the run and render tasks are closed appropriately every where I run and/or render reports. Thanks.
PKofon
<blockquote class='ipsBlockquote' data-author="'PKofon'" data-cid="69447" data-time="1287350929" data-date="17 October 2010 - 02:28 PM"><p>
In my application, I've implemented a listener that ensures that users' temporary files (documents and images generated when they run reports) get deleted automatically once their session is invalidated; e.g. when their sessions time out or when they explicitly log out of the application. However, only the image files get deleted whenever this happens. The document (*.rptdocument) files don't get deleted even though there's nothing wrong with my implementation. Trying to delete them manually generates an error that says the files are currently being used by another process.<br />
<br />
All the temporary files (for every user) get deleted when the server is shutting down. This works as expected, only because the files are deleted after a call to IReportEngine.destroy() and Platform.shutdown().<br />
<br />
While the server is running, is there a way to ensure that BIRT doesn't hold on to the documents so they can be deleted as needed? Note that after rendering the reports, the render task is closed appropriately, so this isn't the issue. Besides, calling IReportDocument.close() on the document doesn't help either. Am I missing something?<br /></p></blockquote>
<br />
This problem occurs because I call IReportEngine.openReportDocument() but fail to call IReportDocument.close() correctly after I'm done with the reports. I modified my code and tried again and found out that calling IReportDocument.close() after running/rendering the reports actually solves this problem. Of course, I also call close() on IRunTask and IRenderTask after using them.<br />
<br />
Strangely, all the examples I have seen on opening and rendering a report document fail to call IReportDocument.close() so I thought it was only necessary to close the run/render tasks. Well, I looked in BIRT's source code and discovered that closing a run/render task doesn't close the report document associated with it. My mistake!