[fdo-users] .net Wrapper quirks

Jackie C. Ng jumpinjackie at gmail.com
Fri Oct 31 08:55:52 EDT 2008


Sorry to necro this discussion but it seems the dreaded
System.AccessViolationException has reared its ugly head again in my testing
of FDO Toolbox with the PostGIS and OGR providers (I'm testing on the trunk
build of FDO). I guess I need clarification on the following matters:

1 - Dispose() or no? Should I just be letting the GC do its job. Could I be
screwing up reference counts by Disposing objects myself, thus possibly
causing these errors?

2 - The devguide states that method chaining is bad. Does this still apply
with the managed wrappers?

- Jackie


gregboone wrote:
> 
> This is the primary cause of the defect as it results in an excessive
> number of SQLite resources being instantiated and used before enough
> resources are freed by the garbage collector. As a work-around, calling
> Close()/Dispose() should resolve the issue. However, we will also try and
> make a fix in the SDF provider so that these steps are not explicitly
> necessary.
> 
> One last point, you still should explicitly assign the result of Execute
> to a Feature Reader so that the garbage collection can happen at an
> appropriate time.
> 
> Greg
> 
> -----Original Message-----
> From: fdo-users-bounces at lists.osgeo.org
> [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Jackie Ng
> Sent: Friday, April 04, 2008 2:38 AM
> To: fdo-users at lists.osgeo.org
> Subject: Re: [fdo-users] .net Wrapper quirks
> 
> 
> I just looked at the unit test code for the ticket, and noticed I might
> have
> been doing something wrong.
> 
> I forgot that IInsert::Execute() returns an IFeatureReader and so I
> haven't
> been closing and disposing them.
> 
> One (of many?) possible cause(s)?
> 
> - Jackie
> 
> 
> Jackie Ng wrote:
>>
>> Hi All,
>>
>> I've been writing .net code that copies data from one FDO connection to
>> another (Doing a series of IInsert::Execute() calls from an
>> IFeatureReader
>> ). In my adventures using the FDO .net wrapper, I have encountered the
>> following problems at random:
>>
>> - System.AccessViolationExceptions ("Attempted to read or write protected
>> memory. This is often an indication that other memory is corrupt") thrown
>> at OSGeo.FDO.Runtime.Disposable.Finalize() (Target Site: void
>> ReleaseUnmanagedObject() )
>> - C++ pure virtual function call errors.
>> - Memory allocation failed errors.
>>
>> Is there some quirks with the .net wrapper that I should be aware of? As
>> OSGeo.FDO.Runtime.Disposable implements IDisposable, I've been wrapping
>> nearly every FDO object used inside using() blocks. Could this be a
>> cause?
>>
>> I am using .net wrappers for FDO 3.3.0
>>
>> - Jackie
>>
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/.net-Wrapper-quirks-tp16318694s18162p16485877.html
> Sent from the fdo-users mailing list archive at Nabble.com.
> 
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> 
> 


-----
http://themapguyde.blogspot.com

http://www.linkedin.com/in/jackieng
-- 
View this message in context: http://www.nabble.com/.net-Wrapper-quirks-tp16318694p20265376.html
Sent from the FDO Users mailing list archive at Nabble.com.



More information about the fdo-users mailing list