PDA

View Full Version : Bugs with the database


blarouche
10-16-2009, 08:51 AM
Problems with the database.

I had a problem with the database and tried to Reset it.


Here is the trace that I got :

2009-10-15 22:26:08:830 in OnUnhandledThreadException
2009-10-15 22:26:08:971 ********* exception trapped *********
2009-10-15 22:26:08:971 The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK__nt_strategy2strategy__00000000000002D4 ]
2009-10-15 22:26:08:971 at System.Data.SqlServerCe.SqlCeCommand.ProcessResult s(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman dText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman d(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQue ry()
at Wilson.ORMapper.Internals.Connection.ExecuteComman d(Type entityType, CommandInfo commandInfo, String sqlStatement, Parameter[] parameters)
at Wilson.ORMapper.ObjectSpace.ExecuteDelete(Type objectType, String whereClause)
at NinjaTrader.Gui.OptionsForm.OnResetDB(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

NinjaTrader_Dierk
10-16-2009, 08:53 AM
To clarify: you got that trace as you tried to repair the DB? So it was not your original problem?

If so, the please mail me your zipped DB to "dierk AT ninjatrader DOT com". Thanks

blarouche
10-16-2009, 09:03 AM
Dierk


what I did is that I put a print statement in a strategy that was way too big which froze NT.

I had to shut it down.
After that I repair the DB, worked well but the strategies were working in a strange way. I was not getting the same result after than before.

So I tried to reset the DB and this is when I got the ugly error message from NT...


Bernard

NinjaTrader_Dierk
10-16-2009, 09:05 AM
Got it. Please send me the zipped DB file <my documents>/NinjaTrader 7/db/NinjaTrader.sdf as per below. Thanks

blarouche
10-16-2009, 09:10 AM
Dierk

I will....

Thanks

Bernard