Profile Picture

trouble with SaveTick(string List )

Posted By DTrader 7 Years Ago
Message
Pinch Posted Thursday July 15 2010
I'm wrapping the RE LinqToSqlServer and calling into the public method SaveTick(string Symbol, List tickDataList). I have a valid list of valid TickData items I'm sending to the method. The behavior is that the symbols get into the dataStore, but the tickdata do not.

Any clues?

The local variables look thus:

      Symbol   "MfBBAwm"   string
-      tickDataList   Count = 60   System.Collections.Generic.List
+      [0]   {Trade: 1 @ 125, 6/7/2010 12:00:00 PM}   RightEdge.Common.TickData
+      [1]   {Trade: 1 @ 125, 6/7/2010 12:00:01 PM}   RightEdge.Common.TickData
+      [2]   {Trade: 1 @ 125, 6/7/2010 12:00:02 PM}   RightEdge.Common.TickData
+      [3]   {Trade: 1 @ 125, 6/7/2010 12:00:03 PM}   RightEdge.Common.TickData
+      [4]   {Trade: 1 @ 125, 6/7/2010 12:00:04 PM}   RightEdge.Common.TickData
...

nice ToString() use btw.
Posted Thursday July 15 2010
Are you checking for exceptions? If you're in "backwards compatible" mode, tick data isn't supported. It should throw a NotSupportedException that reads "Tick data storage not supported with the backwards compatible database format. You can upgrade to the new database format from the data store settings."

DTrader (7/15/2010)
I'm wrapping the RE LinqToSqlServer and calling into the public method SaveTick(string Symbol, List tickDataList). I have a valid list of valid TickData items I'm sending to the method. The behavior is that the symbols get into the dataStore, but the tickdata do not.

Any clues?

The local variables look thus:

      Symbol   "MfBBAwm"   string
-      tickDataList   Count = 60   System.Collections.Generic.List
+      [0]   {Trade: 1 @ 125, 6/7/2010 12:00:00 PM}   RightEdge.Common.TickData
+      [1]   {Trade: 1 @ 125, 6/7/2010 12:00:01 PM}   RightEdge.Common.TickData
+      [2]   {Trade: 1 @ 125, 6/7/2010 12:00:02 PM}   RightEdge.Common.TickData
+      [3]   {Trade: 1 @ 125, 6/7/2010 12:00:03 PM}   RightEdge.Common.TickData
+      [4]   {Trade: 1 @ 125, 6/7/2010 12:00:04 PM}   RightEdge.Common.TickData
...

nice ToString() use btw.
Posted Thursday July 15 2010
I assumed that since the newest RE version is the only version I've installed, when I set up the db through the RE UI that is set it up in non-backward compatible mode. I see that the default mode is non-backward compatible. The database schema (through the enterprise server manager) shows a table for dbo.tick. Is there something I'm missing? Should I explicitly set the backward compatible mode? Is it possible the db is legacy schema even though I configured through build 21?

clues, clues..

   public enum DatabaseSchema
   {
      Default = 0,
      [Description("Backwards Compatible")]
      BackwardsCompatible = 1,
   }

thanks in advance.
Posted Thursday July 15 2010
No, backwards compatible mode will not support saving ticks. I was simply making sure that that wasn't set. Can you set a breakpoint on the Save method in LinqToSQLStorage.cs and see if it gets called?

DTrader (7/15/2010)
I assumed that since the newest RE version is the only version I've installed, when I set up the db through the RE UI that is set it up in non-backward compatible mode. I see that the default mode is non-backward compatible. The database schema (through the enterprise server manager) shows a table for dbo.tick. Is there something I'm missing? Should I explicitly set the backward compatible mode? Is it possible the db is legacy schema even though I configured through build 21?

clues, clues..

   public enum DatabaseSchema
   {
      Default = 0,
      [Description("Backwards Compatible")]
      BackwardsCompatible = 1,
   }

thanks in advance.
Posted Thursday July 15 2010
Okay, I'm making progress on this; ignore for now.
Posted Thursday July 15 2010
okay here's what I've got.

I've added the LinqToSqlStorage source to my project rather than wrapping the external dll, so now I can step through. I can't tell you how much it means to be able to do that.

It appears the problem arises because I am repeatedly calling IDataAccessor Save(IList items) a hundred or so times to save 60 TickData objects without a breather


Let me know if you have any suggestions. I can probably implement a spoonfeed hack (something in TimeOperation mebbe), but the long-term fix is something you might want to look at.


Here is the CLR error message (I can't tell exactly when it is triggered because it won't trigger unless I clear the breakpoints and let fly):


ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x513e090 to COM context 0x513e200 for 60 seconds.
The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages.
This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time.
To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

much appreciated
Posted Thursday July 15 2010
File this issue for later.

looks like the spoonfeed hack works; I just wait for n seconds between each file I process; probably any yield would give the message pump a chance to grab the execution thread and catch up.

            System.Threading.Thread.CurrentThread.Join(300);

seems to do the trick.
Posted Monday July 19 2010
DTrader (7/15/2010)
I've added the LinqToSqlStorage source to my project rather than wrapping the external dll, so now I can step through. I can't tell you how much it means to be able to do that.


You might want to look at .NET Reflector Pro. It costs money, but it will decompile assemblies for you and let you step through them in debug mode.

Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems