lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy" <digyd...@gmail.com>
Subject RE: [jira] Commented: (LUCENENET-174) RAMDirectory Not Correctly Serilizing
Date Tue, 10 Mar 2009 16:24:37 GMT
I am personally using TortoiseSVN to update/commit/create patch etc. (http://tortoisesvn.tigris.org/)
But there are also many other solutions available for free.

DIGY.

-----Original Message-----
From: Philip Todd (JIRA) [mailto:jira@apache.org] 
Sent: Tuesday, March 10, 2009 5:53 PM
To: lucene-net-dev@incubator.apache.org
Subject: [jira] Commented: (LUCENENET-174) RAMDirectory Not Correctly Serilizing


    [ https://issues.apache.org/jira/browse/LUCENENET-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680517#action_12680517
] 

Philip Todd commented on LUCENENET-174:
---------------------------------------

Thanks DIGY,

Your fix seems to be working fine. 

For future reference - as I'll be using Lucene.Net for some time now with this new application
(and probably more in future), can you point me to some info about how to create a ".diff"
or ".patch" file?


Cheers,
Phil



> RAMDirectory Not Correctly Serilizing
> -------------------------------------
>
>                 Key: LUCENENET-174
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-174
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Lucene.Net version 2.1
> Windows XP 64Bit SP2
> Visual Studio 2008 SP1
> DOTNET 3.5 SP1
> NCache Developer 3.4
>            Reporter: Philip Todd
>            Priority: Minor
>         Attachments: Store.zip
>
>   Original Estimate: 0.17h
>  Remaining Estimate: 0.17h
>
> Greetings. Firstly a big thank you for everyones efforts with Lucene and Lucene.Net.
Your efforts are much appreciated.
> Background:
> I have created a server application which allows searching across many companies. In
order to achieve this I have utilized Lucene.Net for indexing and searching and NCache from
Alachisoft for caching the information server-side. As the Lucene index takes a fair amount
of time to create - I am also caching the RAMDirectory. The caching requires all objects to
be serialized before storage.
> The issue:
> After retrieving the RAMDirectory from cache (after de-serializing) I attempted to create
a new IndexWriter object to allow adding more items to the index:
>             oDirectory = CacheConfig.DeCacheSupplierIndex("SupplierIndex" & Supplier.BuyerNo)
>             analyzer = New StandardAnalyzer()
>             oIndexWriter = New IndexWriter(oDirectory, analyzer, False)
> The attempt to create the IndexWriter resulted in a NullReference exception at:
>            at Lucene.Net.Store.Directory.MakeLock(String name)
>            at Lucene.Net.Index.IndexWriter.Init(Directory d, Analyzer a, Boolean create,
Boolean closeDir)
>            at Lucene.Net.Index.IndexWriter..ctor(Directory d, Analyzer a)
>    
> After debugging the Lucene source I discovered the exception was caused by the lockFactory
definition in the Directory class (Directory.cs line 49) having a [NonSerialized] attribute.
This caused the lockFactory to be null after serialization.
> Fix:
> Removed the [NonSerialized] attribute. 
> Added a [Serializable] attribute to SingleInstanceLockFactory (SingleInstanceLockFactory.cs
line 35)
> Added a [Serializable] attribute to LockFactory (LockFactory.cs line 28)
> This allowed me to proceed. I have not thoroughly tested the changes. I can provide the
source code if required.
> As we will very likely upgrade to future versions of Lucene - I would like to have any
fix incorporated into the Lucene source repository. Let me know what I should do.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message