ASP.NET-MVC (IIS6) Ошибка на интенсивном трафике: Указанный бросок не допустим

Опция поискового запроса (q =)

Если вы хотите получать сообщения с определенной меткой, вы можете использовать этот запрос:

GET https: //www.googleapis.com/blogger/v3/blogs/2399953/posts/search?q=label:label1&key=THE-KEY

Если вы хотите получать сообщения с пометкой ' это ', а также ' то '(если один из них не совпадает, это не совпадение), вы можете использовать:

GET https: //www.googleapis. com / blogger / v3 / blogs / 2399953 / posts / search? q = метка: this + метка: тот & ключ = THE-KEY

Используйте кавычки вокруг меток с пробелами:

[1117 ] GET https://www.googleapis.com/blogger/v3/blogs/15045980/posts/search?q=label%3A%22James+Whittaker%22&key=THE-KEY

Вероятно, лучший вариант, чтобы получать сообщения по ярлыкам

Источник: https://developers.google.com/blogger/docs/3.0/reference/posts/list

HTTP-запрос:

GET https://www.googleapis.com/blogger/v3/blogs/blogId/posts

Среди необязательных параметров есть [1 11] параметр:

labels string Comma-separated list of labels to search for.

Пример HTTP-запроса (с использованием blogId блога тестирования Google):

GET https: //www.googleapis. com / blogger / v3 / blogs / 15045980 / posts? label = James + Whittaker & amp; key = THE-KEY

Обратите внимание, что кавычки вокруг метки не должны быть включены , а не , используя это вариант.

Для получения следующей страницы постов сохраните заданный nextPageToken, как указано в комментариях, и поместите его в параметр pageToken, например:

GET https: // www.googleapis.com/blogger/v3/blogs/15045980/posts?labels=James+Whittaker&pageToken=CgkIChiAjpb65CUQ3KqWBw&key=THE-KEY

9
задан Jeff Atwood 25 November 2008 в 20:54
поделиться

2 ответа

We had a similar problem with LINQ that we get "Unable to cast object of type 'System.Int32' to type 'System.String'" and "Specified cast is not valid."

Examples of stacktraces

System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
   at System.Data.SqlClient.SqlBuffer.get_String()
   at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
   at Read_Person(ObjectMaterializer`1 )
   at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at RF.Ias.Services.Person.BusinessLogic.PersonTransactionScripts.GetPersons(IEnumerable`1 personIds, Boolean includeAddress, Boolean includeContact)
   at CompositionAopProxy_5b0727341ad64f29b816c1b73d11dd44.GetPersons(IEnumerable`1 personIds, Boolean includeAddress, Boolean includeContact)
   at RF.Ias.Services.Person.ServiceImplementation.PersonService.GetPersons(GetPersonRequest request)


System.InvalidCastException: Specified cast is not valid.
   at System.Data.SqlClient.SqlBuffer.get_Int32()
   at System.Data.SqlClient.SqlDataReader.GetInt32(Int32 i)
   at Read_GetRolesForOrganisationResult(ObjectMaterializer`1 )
   at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at RF.Ias.Services.Role.DataAccess.RoleDataAccess.GetRolesForOrganisation(GetRolesForOrganisationCriteria criteria, Int32 pageIndex, Int32 pageSize, Int32& recordCount)
   at RF.Ias.Services.Role.BusinessLogic.RoleTransactionScripts.GetRolesForOrganisation(GetRolesForOrganisationCriteria criteria, Int32 pageIndex, Int32 pageSize, Int32& recordCount)
   at CompositionAopProxy_4bd29c6074f54d10a2c09bd4ab27ca66.GetRolesForOrganisation(GetRolesForOrganisationCriteria criteria, Int32 pageIndex, Int32 pageSize, Int32& recordCount)
   at RF.Ias.Services.Role.ServiceImplementation.RoleService.GetRolesForOrganisation(GetRolesForOrganisationRequest request)

We used to get these exceptions if we first got a exception like this "System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first." or " A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)".

The first exception occur for a different instance of the DataCOntext then for all those that then are following.

After some research and asking in this thread , I found that the reason was that I did not dispose the DataContexts. After I started to do that, it dissappered.

7
ответ дан 4 December 2019 в 21:13
поделиться

Походит, возможно, на состояние состязания или возможно редкую ошибку, которая только коррелируется с интенсивным трафиком, потому что это, когда большинство Ваших запросов происходит.

3
ответ дан 4 December 2019 в 21:13
поделиться
Другие вопросы по тегам:

Похожие вопросы: