加载Web服务中的问题,否则它们在开发环境中工作正常。 [英] Issues in web services under load otherwise they work fine in development environment.

查看:292
本文介绍了加载Web服务中的问题,否则它们在开发环境中工作正常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们的网络服务平均每天点击1,00,000次点击。网络服务内置.net,实体框架和SQL服务器。

我们低于例外情况。但是,有时我们在.Net和DB方面都没有得到任何响应。有人请帮忙。



1)系统.Threading.ThreadAbortException



System.Threading.ThreadAbortException:线程被中止。

2) System.InvalidOperationException:ValueFactory



System.InvalidOperationException:ValueFactory试图访问此实例的Value属性。

at System.Lazy`1.CreateValue()

at System.Lazy`1.LazyInitValue()

AutoMapper.Mappers.ConvertMapper.MapExpression(TypeMapRegistry typeMapRegistry,IConfigurationProvider configurationProvider, PropertyMap propertyMap,Expression sourceExpression,Expression destExpression,Expression contextExpression)

AutoMapper.Execution.TypeMapPlanBuilder.MapExpression(TypeMapRegistry typeMapRegistry,IConfigurationProvider configurationProvider,TypePair typePair,E xpression sourceParameter,Expression contextParameter,PropertyMap propertyMap,Expression destinationParameter)
at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(PropertyMap propertyMap)

at AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap(PropertyMap物业地图)

在AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(表达式destinationFunc,Boolean constructorMapping)

在AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda()

在AutoMapper.TypeMap.Seal(TypeMapRegistry typeMapRegistry,IConfigurationProvider configurationProvider)

at AutoMapper.MapperConfiguration.Seal()

at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression,IEnumerable `1 mappers)



3) System.NullReferenceException

System.NullReferenceException:对象引用未设置为一个对象的实例。



我的尝试:



我试图进一步优化我的商店程序,因为所有业务逻辑/操作在那里完成。


We have web services which experience on average 1,00,000 hits on a day.The web services are built in .net,Entity Framework and SQL server.
we are getting below exceptions. However, sometime we don't getting any response in spite of Error handling at both .Net and DB side.Can somebody please help.

1)System.Threading.ThreadAbortException

"System.Threading.ThreadAbortException: Thread was being aborted."
2)System.InvalidOperationException: ValueFactory

"System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance.
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at AutoMapper.Mappers.ConvertMapper.MapExpression(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider, PropertyMap propertyMap, Expression sourceExpression, Expression destExpression, Expression contextExpression)
at AutoMapper.Execution.TypeMapPlanBuilder.MapExpression(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider, TypePair typePair, Expression sourceParameter, Expression contextParameter, PropertyMap propertyMap, Expression destinationParameter)
at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc(PropertyMap propertyMap)
at AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap(PropertyMap propertyMap)
at AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc(Expression destinationFunc, Boolean constructorMapping)
at AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda()
at AutoMapper.TypeMap.Seal(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider)
at AutoMapper.MapperConfiguration.Seal()
at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression, IEnumerable`1 mappers)
"
3)System.NullReferenceException
System.NullReferenceException: Object reference not set to an instance of an object.

What I have tried:

I have tried to further optimize my store procedure because all the business logic/manipulations are done there.

推荐答案

Quote:

系统。 Threading.ThreadAbortException:线程被中止

System.Threading.ThreadAbortException: Thread was being aborted



你中止了一个线程并且没有处理在线程中引发的ThreadAbortException。这是终止线程的一种可怕方式,可能导致资源泄漏。




You aborted a thread and didn't handle the ThreadAbortException that gets raised in the thread. That's a horrible way to terminate a thread and can lead to resource leaks.

引用:

System.InvalidOperationException:ValueFactory试图访问此实例的Value属性

System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance



这可能是因为您尝试访问模型对象上的属性但未加载来自数据库的属性值。




This is probably because you're trying to access a property on a model object and haven't loaded that property value from the database yet.

Quote:

System.NullReferenceException:对象引用未设置为对象的实例。

System.NullReferenceException: Object reference not set to an instance of an object.



您的代码正在尝试对null对象使用属性或方法。你的代码是假设你有一个对象的实例但它实际上是null。你是唯一一个能够找到这个的人。我们没有代码,也没有用来缩小此代码的数据。





在所有这些情况下,你的代码中有bug。您将不得不查看出现这些错误的代码部分并开始调试以找出每个问题的根本原因。


You're code is trying to use a property or method on a null object. You're code is assuming that you have an instance of some object but it's actually null. YOU are the only one who is going to be able to find this one. We don't have the code nor the data it uses to be able to narrow this one down.


In all of these cases, you have bugs in your code. You're going to have to look at the sections of code where these bugs are coming up and start debugging it to find the root cause of each of these problems.


这篇关于加载Web服务中的问题,否则它们在开发环境中工作正常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆