[
https://issues.apache.org/jira/browse/DERBY-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-590:
--------------------------------
Attachment: derby-590-17-aa-closeInputStreamOnPropertiesFile.diff
Attaching derby-590-17-aa-closeInputStreamOnPropertiesFile.diff. This patch
addresses a file closure bug (DERBY-6536) which was causing errors on Windows
platforms.
As part of dropping an index (or unloading the plugin), we need to delete files
and directories. The original code for this deletion never checked the boolean
return status of File.delete(). I have added code so that we check that status
now and raise an error if the deletion fails.
Once I made that change, the offending file popped into focus when I ran the
test case on DERBY-6536. The file is the derby-lucene.properties file which
holds the persistent metadata for the Lucene index. The file was being read
through a FileInputStream which was created transiently as an argument to
Properties.load. The transient stream was never explicitly closed. Maybe it was
being garbage collected (and closed) sooner on non-Windows systems and that's
why we only saw this problem on Windows. The code now stores the stream in a
variable so that it can be closed explicitly after the properties are loaded.
This causes the test case on DERBY-6536 to run cleanly. The whole LuceneSuite
now runs cleanly on that Windows platform.
Touches the following file:
M java/optional/org/apache/derby/optional/lucene/LuceneSupport.java
> How to integrate Derby with Lucene API?
> ---------------------------------------
>
> Key: DERBY-590
> URL: https://issues.apache.org/jira/browse/DERBY-590
> Project: Derby
> Issue Type: Improvement
> Components: Documentation, SQL
> Reporter: Abhijeet Mahesh
> Labels: derby_triage10_11
> Attachments: derby-590-01-ag-publicAccessToLuceneRoutines.diff,
> derby-590-01-ah-publicAccessToLuceneRoutines.diff,
> derby-590-01-am-publicAccessToLuceneRoutines.diff,
> derby-590-02-aa-cleanupFindbugsErrors.diff,
> derby-590-03-aa-removeTestingDiagnostic.diff,
> derby-590-04-aa-removeIDFromListIndexes.diff,
> derby-590-05-aa-accessDeclaredMembers.diff,
> derby-590-06-aa-suppressAccessChecks.diff,
> derby-590-07-aa-accessClassInPackage.sun.misc.diff,
> derby-590-08-aa-omitLuceneFlag.diff,
> derby-590-09-aa-localeSensitiveAnalysis.diff,
> derby-590-10-aa-fixLocaleTest.diff, derby-590-11-aa-moveCode.diff,
> derby-590-12-aa-newJar.diff, derby-590-13-aa-indexViews.diff,
> derby-590-14-aa-coarseGrainedAuthorization.diff,
> derby-590-15-aa-requireHardUpgrade.diff,
> derby-590-16-aa-adjustUpgradeTest.diff,
> derby-590-17-aa-closeInputStreamOnPropertiesFile.diff, lucene_demo.diff,
> lucene_demo_2.diff
>
>
> In order to use derby with lucene API what should be the steps to be taken?
--
This message was sent by Atlassian JIRA
(v6.2#6252)