lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Chiaretta <simone.chiare...@gmail.com>
Subject Re: Still a problem with medium trust: unmanaged code
Date Tue, 25 May 2010 13:37:41 GMT
I don't think anyone is planning to port Lucene to .NET 4 at the moment.
I was just suggesting to switch to VS2008/10 as they both support
multiple-targeting and have enhanced features compared to VS2005.
But that won't affect the end users of the library, just devs
Simo

On Tue, May 25, 2010 at 3:31 PM, Mankowski, Chris <cmankowski@nfp.com>wrote:

> Does anyone know if Lucene is used on the .NET Compact, or .NET Micro
> frameworks?  That could introduce some additional compatibility issues
> if the base build were to be ported to .NET Framework 4.
>
> Are there issues recompiling my own private build of Lucene to .NET
> Framework 4?  Has anyone attempted it?  Just so you know moving the base
> project to .NET Framework 4 will break compatibility with Azure (at the
> present moment).
>
> -----Original Message-----
> From: Leonardo Azize Martins [mailto:lazize@gmail.com]
> Sent: Tuesday, May 25, 2010 7:57 AM
> To: lucene-net-user@lucene.apache.org
> Subject: Re: Still a problem with medium trust: unmanaged code
>
> Hi,
>
> I think that would be a good option to change version of project to
> VS2010
> and to .NET Framework 4.
> OK, the code can be developed with the same sintax as java version, but
> with
> new version of framework and new version of possibilities.
> .NET Framework new version has a lot of improvements.
>
> Regards
>
> 2010/5/25 Simone Chiaretta <simone.chiaretta@gmail.com>
>
> > It seems like in .NET 4 they added an overload of the Flush method
> that
> > ensures all buffers are flushed to the disk
> > http://msdn.microsoft.com/en-us/library/ee474552.aspx
> >
> > <http://msdn.microsoft.com/en-us/library/ee474552.aspx>Too bad it's
> only
> > on
> > .NET 4
> >
> > Speaking of versions, the solution file is still VS2005... are there
> any
> > plans to update it to VS2010, or VS2008 at least?
> >
> > Simone
> >
> > On Tue, May 25, 2010 at 1:29 AM, Robert Jordan <robertj@gmx.net>
> wrote:
> >
> > > On 24.05.2010 23:55, Digy wrote:
> > >
> > >> No, It is not about mono. My hesitation is:
> > >> If a managed process crashes after it's called filestream.Flush(),
> can
> > we
> > >> know for sure that all the data will eventually be written to disk.
> > >>
> > >
> > > A crashing process is not the issue, because the files will be
> > > closed (and flushed) by the OS, unless the machine is going
> > > down.
> > >
> > > Since FileStream.Flush, unlike FlushFileBuffers, does not ensure
> > > that *everything* is flushed, other processes accessing the index
> > > at the same time may see stale info (file size, modification times,
> > > etc). That's the issue. It can be safely ignored, if there are no
> > > competing processes on the same index.
> > >
> > > Robert
> > >
> > >
> > >
> > >> DIGY
> > >>
> > >> -----Original Message-----
> > >> From: Simone Chiaretta [mailto:simone.chiaretta@gmail.com]
> > >> Sent: Tuesday, May 25, 2010 12:45 AM
> > >> To: lucene-net-user
> > >> Subject: Re: Still a problem with medium trust: unmanaged code
> > >>
> > >> Just for a sanity check: I googled for the various discussions on
> this
> > >> topic, and seems like (if I understood correctly as there are
> hundreds
> > of
> > >> messages about it) that the double flush was required to make it
> work in
> > >> Mono. Is that right? If that's the reason I can safely delete it
> and you
> > >> could put the switch in the core.
> > >> Simone
> > >>
> > >> On Mon, May 24, 2010 at 11:28 PM, Simone Chiaretta<
> > >> simone.chiaretta@gmail.com>  wrote:
> > >>
> > >>  Reason is, nobody knows why these two lines are there... maybe
> they are
> > >>> there for a reason :)
> > >>> And since nobody is having that problem except one guy running in
> a
> > >>> pretty
> > >>> strange scenario, I'd play on the safe side and just wrap it in a
> > >>>
> > >> try-catch.
> > >>
> > >>> In a "normal" medium trust on Win7 and Win2008 Server it works
> fine:
> > the
> > >>> tester that is reporting the problem is running on Win2003 Server
> with
> > a
> > >>> custom trust setting (medium trust with something more relaxed and
> > >>>
> > >> something
> > >>
> > >>> less relaxed)
> > >>>
> > >>> Simone
> > >>>
> > >>> 2010/5/24 Digy<digydigy@gmail.com>
> > >>>
> > >>> Hi Simone,
> > >>>
> > >>>> Since you will get a SecurityException everytime sync is called
> in
> > >>>> medium
> > >>>> trust, why don't you just comment out that code.
> > >>>> If I were 100% sure, I would do the same for the Lucene.Net core.
> > >>>>
> > >>>> DIGY
> > >>>>
> > >>>>
> > >>>> -----Original Message-----
> > >>>> From: Simone Chiaretta [mailto:simone.chiaretta@gmail.com]
> > >>>> Sent: Monday, May 24, 2010 11:59 PM
> > >>>> To: lucene-net-user@lucene.apache.org
> > >>>> Subject: Re: Still a problem with medium trust: unmanaged code
> > >>>>
> > >>>> ok, thank you
> > >>>> will wrap it into a silent try-catch block.
> > >>>> Any chances this could be included in Lucene itself? Would suck
> to
> > >>>> apply this change everytime we decide to jump to a newer version
> of
> > >>>> lucene.net
> > >>>>
> > >>>> simo
> > >>>>
> > >>>> On Monday, May 24, 2010, Digy<digydigy@gmail.com>  wrote:
> > >>>>
> > >>>>> In 2.4.0 we only used managed flush code and I never saw a
bug.
> > >>>>> DIGY
> > >>>>>
> > >>>>> -----Original Message-----
> > >>>>> From: Simone Chiaretta [mailto:simone.chiaretta@gmail.com]
> > >>>>> Sent: Monday, May 24, 2010 10:15 PM
> > >>>>> To: lucene-net-user@lucene.apache.org
> > >>>>> Subject: Re: Still a problem with medium trust: unmanaged code
> > >>>>>
> > >>>>> So I can safely delete/try-catch the unmanaged line?
> > >>>>> Simo
> > >>>>>
> > >>>>> On Monday, May 24, 2010, Digy<digydigy@gmail.com>  wrote:
> > >>>>>
> > >>>>>> Hi Simone,
> > >>>>>>
> > >>>>>> Unmanaged flush is the direct port of java. I think using
only
> the
> > >>>>>>
> > >>>>> managed
> > >>>>
> > >>>>> one would be enough.
> > >>>>>> (There were discussions about that in the past, you can
find
> them
> > with
> > >>>>>>
> > >>>>> some
> > >>>>>
> > >>>>>> googling.)
> > >>>>>>
> > >>>>>> DIGY
> > >>>>>>
> > >>>>>> -----Original Message-----
> > >>>>>> From: Simone Chiaretta [mailto:simone.chiaretta@gmail.com]
> > >>>>>> Sent: Monday, May 24, 2010 9:00 PM
> > >>>>>> To: lucene-net-user@lucene.apache.org
> > >>>>>> Subject: Re: Still a problem with medium trust: unmanaged
code
> > >>>>>>
> > >>>>>> Shouldn't the managed Flush be enough? Otherwise this should
be
> a
> > bug
> > >>>>>> in the CLR.
> > >>>>>> Or am I missing something?
> > >>>>>>
> > >>>>>> This blocks Lucene.net to work in some medium trusts.
> > >>>>>> Simo
> > >>>>>>
> > >>>>>> On Monday, May 24, 2010, Robert Jordan<robertj@gmx.net>
 wrote:
> > >>>>>>
> > >>>>>>> On 24.05.2010 17:41, Simone Chiaretta wrote:
> > >>>>>>>
> > >>>>>>> Hi all,
> > >>>>>>> whereas the latest updates fixed the problem with "standard"
> medium
> > >>>>>>>
> > >>>>>> trust,
> > >>>>>
> > >>>>>> in some environment there is also another error being raised:
> > >>>>>>>
> > >>>>>>> [SecurityException: Request for the permission of type
> > >>>>>>> 'System.Security.Permissions.SecurityPermission, mscorlib,
> > >>>>>>>
> > >>>>>> Version=2.0.0.0,
> > >>>>>>
> > >>>>>>> Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
> > >>>>>>>     FileSupport.Sync(FileStream fileStream) in
> SupportClass.cs:495
> > >>>>>>>     Lucene.Net.Store.FSDirectory.Sync(String name)
in
> > >>>>>>>
> > >>>>>> FSDirectory.cs:831
> > >>>>
> > >>>>>     Lucene.Net.Index.SegmentInfos.FinishCommit(Directory dir)
in
> > >>>>>>> SegmentInfos.cs:998
> > >>>>>>>     ....
> > >>>>>>>
> > >>>>>>> It looks like the problem is when the Sync method calls
the
> > unmanaged
> > >>>>>>>
> > >>>>>> code:
> > >>>>>>
> > >>>>>>> private static extern bool FlushFileBuffers(IntPtr
hFile);
> > >>>>>>>
> > >>>>>>> Is there a reason why both the managed and the unmanaged
flush
> are
> > >>>>>>>
> > >>>>>> used?
> > >>>>
> > >>>>>
> > >>>>>>>
> > >>>>>>> Yes. It ensures that the file's cache really hits the
file
> system.
> > >>>>>>> You may want to add a try-catch block around it as
there is
> > >>>>>>> no other way to achieve this w/out calling into unmanaged
> code.
> > >>>>>>>
> > >>>>>>> Robert
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>> --
> > >>>>>> Simone Chiaretta
> > >>>>>> Microsoft MVP ASP.NET <http://asp.net/> - ASPInsider
> > >>>>>> Blog: http://codeclimber.net.nz
> > >>>>>> RSS: http://feeds2.feedburner.com/codeclimber
> > >>>>>> twitter: @simonech
> > >>>>>>
> > >>>>>> Any sufficiently advanced technology is indistinguishable
from
> magic
> > >>>>>> "Life is short, play hard"
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>> --
> > >>>>> Simone Chiaretta
> > >>>>> Microsoft MVP ASP.NET <http://asp.net/> - ASPInsider
> > >>>>> Blog: http://codeclimber.net.nz
> > >>>>> RSS: http://feeds2.feedburner.com/codeclimber
> > >>>>> twitter: @simonech
> > >>>>>
> > >>>>> Any sufficiently advanced technology is indistinguishable from
> magic
> > >>>>> "Life is short, play hard"
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>> --
> > >>>> Simone Chiaretta
> > >>>> Microsoft MVP ASP.NET <http://asp.net/> - ASPInsider
> > >>>> Blog: http://codeclimber.net.nz
> > >>>> RSS: http://feeds2.feedburner.com/codeclimber
> > >>>> twitter: @simonech
> > >>>>
> > >>>> Any sufficiently advanced technology is indistinguishable from
> magic
> > >>>> "Life is short, play hard"
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>> --
> > >>> Simone Chiaretta
> > >>> Microsoft MVP ASP.NET <http://asp.net/> - ASPInsider
> > >>> Blog: http://codeclimber.net.nz
> > >>> RSS: http://feeds2.feedburner.com/codeclimber
> > >>> twitter: @simonech
> > >>>
> > >>> Any sufficiently advanced technology is indistinguishable from
> magic
> > >>> "Life is short, play hard"
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >
> > >
> >
> >
> > --
> >  Simone Chiaretta
> > Microsoft MVP ASP.NET <http://asp.net/> - ASPInsider
> > Blog: http://codeclimber.net.nz
> > RSS: http://feeds2.feedburner.com/codeclimber
> > twitter: @simonech
> >
> > Any sufficiently advanced technology is indistinguishable from magic
> > "Life is short, play hard"
> >
>
> **********************************************************************
> Notice:  This e-mail message and any attachment to this e-mail message may
> contain information that is confidential, proprietary, privileged, legally
> privileged and/or exempt from disclosure under applicable law.  If you are
> not the intended recipient, please accept this as notice that any
> disclosure, copying, distribution or use of the information contained in
> this transmission is strictly prohibited. National Financial Partners Corp.
> reserves the right, to the extent and under circumstances permitted by
> applicable law, to retain, monitor and intercept e-mail messages to and from
> its systems.
>
> Any views or opinions expressed in this e-mail are those of the sender and
> do not necessarily express those of National Financial Partners Corp.
>  Although this transmission and any attachment are believed to be free of
> any virus or other defect that might affect any computer system into which
> it is received and opened, it is the responsibility of the recipient to
> ensure that it is virus free and no responsibility is accepted by NFP, its
> subsidiaries and affiliates, as applicable, for any loss or damage arising
> in any way from its use.
>
> If you have received this e-mail in error, please immediately contact the
> sender by return e-mail or by telephone at 212-301-4000 and destroy the
> material in its entirety, whether electronic or hard copy format.
>



-- 
Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message