DatabaseConnectionWrapper.Dispose(Boolean disposing) throws NullReferenceException

Topics: Data Access Application Block
Sep 6, 2010 at 9:43 AM

Hi Everyone,

Has anyone seen this issue of mine and tried to reproduce it? 

Unless someone tells me what fundamental mistake I am making, I cannot upgrade to version 5.

Best regards

 

Sep 6, 2010 at 10:32 AM

Yes I was able to repro it.  I'm currently investigating this.  I'll keep you posted.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Sep 6, 2010 at 11:49 AM
Edited Sep 6, 2010 at 11:57 AM

Looks like a bug to me.  What changed is the logic of GetOpenConnection.  The second time it tries to get an open connection, the Connection property of the DatabaseConnectionWrapper object has a value of null.  I was able to get around the problem by removing the using statement for the first call to ExecuteXmlReader; meaning avoiding closing the XmlReader prior to executing the second reader.  I closed it after the second one has finished execution.  I'm not recommending to use it as a workaround since it requires keeping the reader open for a while.  Anyway, it's a good thing it's already logged in the issue tracker, the EntLib team might provide a better explanation or workaround.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com