Mikhail Sukhov
|
Дата: 12.02.2011
pyhta4og Смею предположить, что trading.sql не соответствует сборке 3.0.1
Так и есть.
|
|
Спасибо:
|
|
|
|
|
pyhta4og
|
Дата: 12.02.2011
выложите?
|
|
Спасибо:
|
|
|
|
|
pyhta4og
|
Дата: 13.02.2011
|
|
|
|
[3.0.2] Действия: 0. Создал БД со скриптом trading.sql из 3.0.2 1. Запустил Hydra 2. Нажал Инструменты-Обновить 3. Выпал диалог с SQL ошибкой. Она же записана в логи Код Finam 20:46:06.1406250 Вне диапазона времени. RTS 20:46:06.2031250 Вне диапазона времени. Гидра 20:54:01.5156250 System.Data.SqlClient.SqlException: Error 547, Level 16, State 0, Procedure Security_UpdateById, Line 119, Message: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'. Error Number: 547 Line Number: 119 The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'. .... at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Ecng.Data.DatabaseCommand.<ExecuteNonQuery>b__5(DbCommand cmd) at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection) at Ecng.Data.Database.GetConnection(Action`1 action) at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler) at Ecng.Data.DatabaseCommand.ExecuteNonQuery(SerializationItemCollection input) at Ecng.Data.Database.Execute(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal) at Ecng.Data.Database.Update(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal) at Ecng.Data.Database.<>c__DisplayClassf`1.<Update>b__e() at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection keyFields, FieldCollection valueFields) at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection valueFields) at Ecng.Data.Database.Update[TEntity](TEntity entity) at Ecng.Serialization.RelationManyList`1.OnUpdate(TEntity entity) at Ecng.Data.HierarchicalPageLoadList`1.OnUpdate(TEntity entity) at Ecng.Serialization.RelationManyList`1.Update(TEntity entity) at Ecng.Trading.Algo.Storages.BaseStorageEntityList`1.Save(T entity) at Ecng.Trading.Hydra.Core.SecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Core\SecurityStorage.cs:line 69 at Ecng.Trading.Hydra.Finam.FinamSecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Plugins\Finam\FinamSecurityStorage.cs:line 32 at Ecng.Trading.Algo.History.Finam.FinamHistorySource.GetNewSecurities() at Ecng.Trading.Hydra.Finam.FinamTradeSource.GetNewSecurities() in ....
В Ecng.Trading.Hydra.Finam.FinamSecurityStorage.Save(Security) поставил брекпойнт Security=TESTESSR, Exchange=Тестовая биржа Руками создал в Exchange Тестовая биржа и ММВБ в результате Hydra скачала 3000 c чем-то security. Значит, проблема в отсутствии записей в Exchange. Посмотрел базу получилось 314 security из ММВБ и 3304 из Тестовая биржа Но в окне "Инструменты" они не появились, какие бы фильтры я не выбирал. Далее, я поставил источнику "РТС" и "Finam" IsEnabled=true, working from=0:0:0, working to=23.59.59. и нажал "Старт". В итоге в логе получил Код Finam 21:50:00.4687500 Стартовал. Finam 21:50:00.4687500 System.NullReferenceException: Object reference not set to an instance of an object. at Ecng.Trading.Hydra.Finam.FinamTradeSource.Load(Security security) in D:\SS\Sources\Hydra\Plugins\Finam\FinamTradeSource.cs:line 158 at Ecng.Trading.Hydra.Worker.<Download>b__10(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 112
RTS 21:50:00.4843750 Стартовал. RTS 21:51:19.0937500 System.Data.SqlClient.SqlException: Error 547, Level 16, State 0, Procedure Security_UpdateById, Line 119, Message: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'. Error Number: 547 Line Number: 119 The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Security_Exchange". The conflict occurred in database "trading", table "dbo.Exchange", column 'Name'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Ecng.Data.DatabaseCommand.<ExecuteNonQuery>b__5(DbCommand cmd) at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection) at Ecng.Data.Database.GetConnection(Action`1 action) at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler) at Ecng.Data.DatabaseCommand.ExecuteNonQuery(SerializationItemCollection input) at Ecng.Data.Database.Execute(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal) at Ecng.Data.Database.Update(DatabaseCommand command, SerializationItemCollection source, Boolean needRetVal) at Ecng.Data.Database.<>c__DisplayClassf`1.<Update>b__e() at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection keyFields, FieldCollection valueFields) at Ecng.Data.Database.Update[TEntity](TEntity entity, FieldCollection valueFields) at Ecng.Data.Database.Update[TEntity](TEntity entity) at Ecng.Serialization.RelationManyList`1.OnUpdate(TEntity entity) at Ecng.Data.HierarchicalPageLoadList`1.OnUpdate(TEntity entity) at Ecng.Serialization.RelationManyList`1.Update(TEntity entity) at Ecng.Trading.Algo.Storages.BaseStorageEntityList`1.Save(T entity) at Ecng.Trading.Hydra.Core.SecurityStorage.Save(Security security) in D:\SS\Sources\Hydra\Core\SecurityStorage.cs:line 69 at Ecng.Trading.Algo.History.Rts.RtsHistorySource.GetTrades(DateTime time) at Ecng.Trading.Hydra.Rts.RtsTradeSource.Load(Security security) in D:\SS\Sources\Hydra\Plugins\Rts\RtsTradeSource.cs:line 168 at Ecng.Trading.Hydra.Worker.<Download>b__10(IMarketDataSource source) in D:\SS\Sources\Hydra\Hydra\Worker.cs:line 112
Тут сразу две проблемы - одна с передачей null в FinamTradeSource.Load (при загрузке через Finam) вторая, видимо, снова с отсутствующей записью в Exchange (при загрузке через РТС) После этого всего я закрыл Hydra. Когда заново запустил получил на старте Код System.Data.SqlClient.SqlException: Procedure or function 'PageSelect' expects parameter '@columns', which was not supplied. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Ecng.Data.DatabaseCommand.<ExecuteTable>b__a(DbCommand cmd) at Ecng.Data.DatabaseCommand.<>c__DisplayClass3`1.<Execute>b__0(DbConnection connection) at Ecng.Data.Database.GetConnection(Action`1 action) at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler) at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input) at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source) at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions) at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count) at Ecng.Serialization.RelationManyList`1.get_Count() at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean& canProcess) at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at Ecng.Collections.CollectionHelper.AddRange[T](ICollection`1 source, IEnumerable`1 items) at Ecng.Trading.Hydra.MainWindow.FillSecurities() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 155 at Ecng.Trading.Hydra.MainWindow..ctor() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 64 --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) --- End of inner exception stack trace --- at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Это уже вне моего какого бы то понимания, потому что это похоже на stored procedure .net, в чем я слабо разбираюсь, особенно без исходников, но чувствуется что Ecng.Serialization и Ecng.Data вещи нетривиальные ;) Есть догадка, что Ecng.Trading.Hydra.MainWindow.FillSecurities() загружает объекты из таблицы Exchange которые я руками добавил и скорее всего некорректно (все поля кроме Name оставил пустыми) В общем, похоже дело в создании Exchange, но я не знаю толи они должны автоматически создаваться кодом, толи их создание должно быть в trading.sql. Кроме того в trading.sql обнаружил в начале явный CREATE DATABASE с абсолютными путями. Мне кажется создать базу должен пользователь сам, а в скрипте должны инициализироваться все объекты БД. С уважением.
|
|
Спасибо:
|
|
|
|
|
Mikhail Sukhov
|
Дата: 13.02.2011
Да, в PageLoad косяк. Должно выглядеть так: КодCREATE PROCEDURE [dbo].[PageSelect] @table [nvarchar](4000), @startIndex [bigint], @count [bigint], @orderByColumn [nvarchar](4000) = null, @columns [nvarchar](4000) = null, @filter [nvarchar](4000) = null, @param1 [sql_variant] = null, @param2 [sql_variant] = null, @param3 [sql_variant] = null, @param4 [sql_variant] = null, @param5 [sql_variant] = null, @param6 [sql_variant] = null, @param7 [sql_variant] = null, @param8 [sql_variant] = null, @param9 [sql_variant] = null, @param10 [sql_variant] = null AS EXTERNAL NAME [Ecng.Data.SqlServer].[Ecng.Data.SqlServer.SqlExtendedProcedures].[PageSelect] С биржами багу исправил.
|
|
Спасибо:
|
|
|
|
|
Mikhail Sukhov
|
Дата: 13.02.2011
pyhta4og Но в окне "Инструменты" они не появились, какие бы фильтры я не выбирал.
Надо ввести хоть один символ из названия в поле в левом верхнем углу.
|
|
Спасибо:
|
|
|
|
|
pyhta4og
|
Дата: 14.02.2011
|
|
|
|
Mikhail Sukhov Да, в PageLoad косяк. Должно выглядеть так: КодCREATE PROCEDURE [dbo].[PageSelect] @table [nvarchar](4000), @startIndex [bigint], @count [bigint], @orderByColumn [nvarchar](4000) = null, @columns [nvarchar](4000) = null, @filter [nvarchar](4000) = null, @param1 [sql_variant] = null, @param2 [sql_variant] = null, @param3 [sql_variant] = null, @param4 [sql_variant] = null, @param5 [sql_variant] = null, @param6 [sql_variant] = null, @param7 [sql_variant] = null, @param8 [sql_variant] = null, @param9 [sql_variant] = null, @param10 [sql_variant] = null AS EXTERNAL NAME [Ecng.Data.SqlServer].[Ecng.Data.SqlServer.SqlExtendedProcedures].[PageSelect] С биржами багу исправил. Обновил определение процедуры. Теперь десериализовать что-то не может. Чего я только в поля Exchange не записывал. Буду ждать обновления, которое само биржи в базу пишет. Код System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(XmlReader reader) at Ecng.Serialization.XmlSerializer`1.Deserialize(Stream stream, FieldCollection fields, SerializationItemCollection source) at Ecng.Serialization.Serializer`1.Deserialize(Stream stream, SerializationItemCollection source) at Ecng.Data.Database.GroupSource(IEnumerable`1 fields, SerializationItemCollection input, IEnumerable`1 innerSchemaNameOverrides) at Ecng.Data.Database.GetOrAddCache[TEntity](SerializationItemCollection input) at Ecng.Data.Database.Read[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.Database.Read[TEntity](SerializationItemCollection by) at Ecng.Data.Database.Read[TEntity](SerializationItem by) at Ecng.Data.Database.Read[TEntity](Object id) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetById[TEntity](Object id) at Ecng.Serialization.RelationSingleFieldFactory`2.OnCreateInstance(ISerializer serializer, TSource source) at Ecng.Serialization.FieldFactory`2.OnCreateInstance(ISerializer serializer, Object source) at Ecng.Serialization.FieldFactory.CreateInstance(ISerializer serializer, SerializationItem source) at Ecng.Serialization.Serializer`1.Deserialize(SerializationItemCollection source, FieldCollection fields, T graph) at Ecng.Data.Database.<>c__DisplayClass22`1.<GetOrAddCacheTable>b__1d() at Ecng.Data.Database.AddCache[TEntity](TEntity entity, String key, Object id, SerializationItemCollection source, Boolean newEntry, Action action) at Ecng.Data.Database.GetOrAddCacheTable[TEntity](SerializationItemCollection table) at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source) at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions) at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count) at Ecng.Serialization.RelationManyList`1.get_Count() at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean& canProcess) at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at Ecng.Collections.CollectionHelper.AddRange[T](ICollection`1 source, IEnumerable`1 items) at Ecng.Trading.Hydra.MainWindow.FillSecurities() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 155 at Ecng.Trading.Hydra.MainWindow..ctor() in D:\SS\Sources\Hydra\Hydra\MainWindow.xaml.cs:line 64 --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) --- End of inner exception stack trace --- at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
|
|
Спасибо:
|
|
|
|
|
Mikhail Sukhov
|
Дата: 14.02.2011
pyhta4og Обновил определение процедуры.
Теперь десериализовать что-то не может. Чего я только в поля Exchange не записывал. Буду ждать обновления, которое само биржи в базу пишет.
Ставьте это в код Гидры (главное окно, конструктор) и запустите: Код _storage = ConfigManager.ServiceLocator.GetInstance<HydraStorage>();
_storage.Exchanges.Add(Exchange.Test); _storage.Exchanges.Add(Exchange.Micex); _storage.Exchanges.Add(Exchange.Rts);
|
|
Спасибо:
|
|
|
|
|
pyhta4og
|
Дата: 14.02.2011
|
|
|
|
Теперь процедуру Exchange_Create не находит. Код System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The stored procedure 'Exchange_Create' doesn't exist. at System.Data.SqlClient.SqlCommand.DeriveParameters() at System.Data.SqlClient.SqlCommandBuilder.DeriveParameters(SqlCommand command) at Ecng.Data.SqlServerDatabaseProvider.DeriveParameters(DbCommand command) at Ecng.Data.Database.<>c__DisplayClass7.<GetCommand>b__6(Query ) at Ecng.Collections.CollectionHelper.SafeAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`2 handler) at Ecng.Data.Database.GetCommand(Query commandQuery, SerializationItemCollection source) at Ecng.Data.Database.GetCommand(Schema schema, SqlCommandTypes type, FieldCollection keyFields, FieldCollection valueFields, SerializationItemCollection source) at Ecng.Data.HierarchicalDatabase.GetCommand(Schema schema, SqlCommandTypes type, FieldCollection keyFields, FieldCollection valueFields, SerializationItemCollection source) at Ecng.Data.Database.Create[TEntity](TEntity entity) at Ecng.Data.Database.Ecng.Serialization.IStorage.Add[TEntity](TEntity entity) at Ecng.Serialization.RelationManyList`1.OnAdd(TEntity entity) at Ecng.Data.HierarchicalPageLoadList`1.OnAdd(TEntity entity) at Ecng.Serialization.RelationManyList`1.Add(TEntity item) at Ecng.Trading.Hydra.MainWindow..ctor() in
|
|
Спасибо:
|
|
|
|
|
Mikhail Sukhov
|
Дата: 14.02.2011
pyhta4og Теперь процедуру Exchange_Create не находит.
Сорри, описался: Код_storage = ConfigManager.ServiceLocator.GetInstance<HydraStorage>();
_storage.Exchanges.Save(Exchange.Test); _storage.Exchanges.Save(Exchange.Micex); _storage.Exchanges.Save(Exchange.Rts);
|
|
Спасибо:
|
|
|
|
|
pyhta4og
|
Дата: 15.02.2011
|
|
|
|
[3.0.2] Пробовал загрузить Security из хранилища Код IStorage storage = new HierarchicalDatabase("Hydra", "Server=(local);Database=Trading;User ID=trading;Password=trading;"); ITradingStorage tradingStorage = new TradingStorage(storage);
IEnumerable<Security> securities = tradingStorage.Securities; foreach (Security s in securities) { Console.WriteLine(s.Name); }
получил Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied. Код at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Ecng.Data.DatabaseCommand.&lt;ExecuteTable&gt;b__a(DbCommand cmd) at Ecng.Data.DatabaseCommand.&lt;&gt;c__DisplayClass3`1.&lt;Execute&gt;b__0(DbConnection connection) at Ecng.Data.Database.GetConnection(Action`1 action) at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler) at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input) at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source) at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions) at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count) at Ecng.Serialization.RelationManyList`1.get_Count() at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean&amp; canProcess) at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext() at Tests.Program.Main(String[] args) in D:\SS\Sources\Tests\Program.cs:line 23 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.Data.SqlClient.SqlException: Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Ecng.Data.DatabaseCommand.&lt;ExecuteTable&gt;b__a(DbCommand cmd) at Ecng.Data.DatabaseCommand.&lt;&gt;c__DisplayClass3`1.&lt;Execute&gt;b__0(DbConnection connection) at Ecng.Data.Database.GetConnection(Action`1 action) at Ecng.Data.DatabaseCommand.Execute[TResult](IEnumerable`1 input, Func`2 handler) at Ecng.Data.DatabaseCommand.ExecuteTable(SerializationItemCollection input) at Ecng.Data.Database.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection input) at Ecng.Data.HierarchicalDatabase.ReadAll[TEntity](DatabaseCommand command, SerializationItemCollection source) at Ecng.Data.Database.ReadAll[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.Database.Ecng.Serialization.IStorage.GetGroup[TEntity](Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Data.HierarchicalPageLoadList`1.OnGetGroup(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.ReadAll(Int64 startIndex, Int64 count, Field orderBy, SortDirection direction) at Ecng.Serialization.RelationManyList`1.GetRange(Int64 startIndex, Int64 count, String sortExpression, SortDirection directions) at Ecng.Collections.BaseListEx`1.GetRange(Int64 startIndex, Int64 count) at Ecng.Serialization.RelationManyList`1.get_Count() at Ecng.Serialization.RelationManyList`1.RelationManyListEnumerator.ProcessMove(Boolean&amp; canProcess) at Ecng.Collections.BaseEnumerator`2.System.Collections.IEnumerator.MoveNext() at Tests.Program.Main(String[] args) in D:\SS\Sources\Tests\Program.cs:line 23 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><DataItems><Data><Key>HelpLink.ProdName</Key><Value>Microsoft SQL Server</Value></Data><Data><Key>HelpLink.ProdVer</Key><Value>10.50.1600</Value></Data><Data><Key>HelpLink.EvtSrc</Key><Value>MSSQLServer</Value></Data><Data><Key>HelpLink.EvtID</Key><Value>201</Value></Data><Data><Key>HelpLink.BaseHelpUrl</Key><Value>http://go.microsoft.com/fwlink</Value></Data><Data><Key>HelpLink.LinkId</Key><Value>20476</Value></Data></DataItems></Exception></TraceRecord> An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
Additional information: Procedure or function 'Security_ReadAll' expects parameter '@StartIndex', which was not supplied.
Странно тк, в гидре похожая вещь в FillSecurities проходит успешно Код private void FillSecurities() { this.SecuritiesCtrl.Securities.Clear(); this.SecuritiesCtrl.Securities.AddRange(_storage.Securities.Select(s => new VisualSecurity(s)).Where(s => s.IsSelected)); }
В чем может быть дело?
|
|
Спасибо:
|
|
|
|