The connection was not closed.
Posted: Fri 23 Dec 2011 10:53
Hi,
we see following exception appear on occasion in our log files, in the production environment.
Any idea what we can do about this ? It looks to me that the connection returned from the pool cannot be opened, because it is already open ?
Because the error is not reproducable yet, I would consider logging all 'connection' actions, but since the connection does not have a trackable 'id' - property, i dont see how increasing my logging, will help me to find out where this invalid connection comes from, and how to prevent it.
Any tips ?
We are using a client server application with wcf and entity framework,
devart version : 6.30.202.
The error seems to happen in the validation, where a new repository is created which in turn creates a new ef-context object.
Type : System.Data.EntityException, System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The underlying provider failed on Open.
Source : System.Data.Entity
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void OpenStoreConnectionIf(Boolean, System.Data.Common.DbConnection, System.Data.Common.DbConnection, System.String, System.String, Boolean ByRef)
Stack Trace : at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Afda.BL.Afda_PatientenServerSideValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.AndCompositeValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.GenericValidatorWrapper`1.DoValidate(T objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validator`1.Validate(T target, ValidationResults validationResults)
at Afda.BL.Afda_PatientenBL.Validate(Afda_Patienten item, String afdeling_cd)
at Afda.BL.Afda_PatientenBL.Save(Afda_Patienten item, String afdelingCode, BeforeSaveQuestionList responses, Boolean launchPhase2, Afda_Patienten& copybeforesave)
Inner Exception
---------------
Type : System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The connection was not closed.
Source : Devart.Data.Oracle
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Open(Devart.Common.DbConnectionBase)
Stack Trace : at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Oracle.OracleConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
we see following exception appear on occasion in our log files, in the production environment.
Any idea what we can do about this ? It looks to me that the connection returned from the pool cannot be opened, because it is already open ?
Because the error is not reproducable yet, I would consider logging all 'connection' actions, but since the connection does not have a trackable 'id' - property, i dont see how increasing my logging, will help me to find out where this invalid connection comes from, and how to prevent it.
Any tips ?
We are using a client server application with wcf and entity framework,
devart version : 6.30.202.
The error seems to happen in the validation, where a new repository is created which in turn creates a new ef-context object.
Type : System.Data.EntityException, System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The underlying provider failed on Open.
Source : System.Data.Entity
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void OpenStoreConnectionIf(Boolean, System.Data.Common.DbConnection, System.Data.Common.DbConnection, System.String, System.String, Boolean ByRef)
Stack Trace : at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Afda.BL.Afda_PatientenServerSideValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.AndCompositeValidator.DoValidate(Object objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validators.GenericValidatorWrapper`1.DoValidate(T objectToValidate, Object currentTarget, String key, ValidationResults validationResults)
at Microsoft.Practices.EnterpriseLibrary.Validation.Validator`1.Validate(T target, ValidationResults validationResults)
at Afda.BL.Afda_PatientenBL.Validate(Afda_Patienten item, String afdeling_cd)
at Afda.BL.Afda_PatientenBL.Save(Afda_Patienten item, String afdelingCode, BeforeSaveQuestionList responses, Boolean launchPhase2, Afda_Patienten& copybeforesave)
Inner Exception
---------------
Type : System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The connection was not closed.
Source : Devart.Data.Oracle
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Open(Devart.Common.DbConnectionBase)
Stack Trace : at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Oracle.OracleConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)