ProjectTrackercs 4.1 DataPortal.Fetch failed (Invalid operation - fetch not allowed)

ProjectTrackercs 4.1 DataPortal.Fetch failed (Invalid operation - fetch not allowed)

Old forum URL: forums.lhotka.net/forums/t/10072.aspx


WillTartak posted on Monday, February 14, 2011

So I feel like a fool having to post this but I cant seem to get the ProjectTracker 4.1 cs version to run on my box.

System: Windows 7 Enterprise 64bit

I've tried a lot of things to get this to run, changing all of the config files, moving the dbs to full SqlServer, etc. After nothing worked I figured there was something really stupid I am overlookiing and I just can't figure out what it is. I've searched the forums for hours looking for a solution, none so far.

Any help would be appreciated.

At this point I deleted the folder I was working from, extracted the samples all over again and copied them to c:\Visual Studio Projects\Csla\Sampes\...

Then I built the solution, which built without any problems. Made sure that PTWin was the startup project and pressed F5.

I get the following:

Csla.DataPortalException
DataPortal.Fetch failed (Invalid operation - fetch not allowed)

Inner BusinessException = {"Invalid operation - fetch not allowed"} (No Inner Exception)

InnerException = {"DataPortal_Fetch method call failed"}

InnerException = {"Invalid operation - fetch not allowed"}

The InnerException stack traces are just shorter than the outer so here is the outer...

Stack Trace for outer exception =

   at Csla.ReadOnlyBase`1.DataPortal_Fetch(Object criteria)
   at lambda_method(Closure , Object , Object[] )
   at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters)
   at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters)
   at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters)
   at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters)
   at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context)
   at Csla.DataPortal.Fetch(Type objectType, Object criteria)
   at Csla.DataPortal.Fetch[T](Object criteria)
   at ProjectTracker.Library.Security.PTIdentity.GetIdentity(String username, String password) in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 28
   at ProjectTracker.Library.Security.PTPrincipal.Login(String username, String password) in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTPrincipal.cs:line 31
   at PTWin.LoginForm.OK_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\PTWin\LoginForm.cs:line 23
   at System.Windows.Forms.Button.PerformClick()
   at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at PTWin.MainForm.DoLogin() in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\PTWin\MainForm.cs:line 327
   at PTWin.MainForm.LoginToolStripButton_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\PTWin\MainForm.cs:line 317
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at PTWin.Program.Main() in C:\Visual Studio Projects\Csla\Samples\NET\cs\ProjectTrackercs\PTWin\Program.cs:line 17
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Thanks,

\ ^ / i l l

 

JonnyBee replied on Monday, February 14, 2011

ProjectTracker is not updated and functional for Csla 4.1.

You should rather look at SimpleNTier sample for now.

JCardina replied on Monday, February 14, 2011

Yikes! Surprise

Seriously?  I've been using it as a reference to the "correct" way to do things.

I missed the area on the website or docs or in that zip where it says not to use ProjectTracker as a reference for 4.1

 

WillTartak replied on Monday, February 14, 2011

Eek!!!!

I wish I'd seen that somewhere. It isn't in the faq for example or in the read me for the samples. That's the kind of thing that should be clear somewhere. Especially for someone like me who has used Csla before but is not here to keep up with things all the time.

On SimpleNTier, is the Windows app supposed to do anything? How is one supposed to know if things worked on through to the database? I've only looked at the Windows app so far but it seems less than ideal from a functionality perspective.

Is there a more useful sample than SimpleNTier I can look at?

Thanks,

\ ^ / i l l

JonnyBee replied on Monday, February 14, 2011

Well, it has been stated on the forum several times that ProjectTracker is not working. 

We just haven't had the time to update ProjectTracker but have chosen to not remove it as Rocky plans to update the sample.

 

 

WillTartak replied on Monday, February 14, 2011

Hi Jonny,

 

Not to be a jerk, but to clarify. I searched the forum for anything I could find on Project Tracker and did not find a reference to it not working with 4.x. I don't doubt there have been prior discussions but relying on that as the ultimate source of information is not the best practice. All of us search in different ways.

I wasted a lot of time on this and can only imagine others have too and were just as embarassed to ask about something that seems like it should work as posted.

I thank you for pointing out the error of my ways.

I would appreciate it if you could point me in the direction of a sample that actually writes to a db for 4.1.

 

thanks,

 

\ ^ / i l l

CyclingFoodmanPA replied on Monday, February 14, 2011

Hey,

Don't feel bad.  ProjectTracker is what I consider the "gold standard" for Csla and I have been using it for ages.  I spent a few hours trying to figure out what was going on when it wouldn't work.  The samples InventoryDemo provided me with the most help along with SimpleApp and SimpleNTier as they are all using the "ObjectFactory" now.

Now that I have been messing with ObjectFactory I like it and am used to it.  I would hope that ProjectTracker would be updated to reflect all current stuff because that is the most realistic business type application to date.  I may even update it with ObjectFactory and EF for everyone else, however I am in Telerik Control land along with Database Design, and everything else.

Hang in there,

CyclingFoodmanPA

WillTartak replied on Monday, February 14, 2011

Hi CyclingFoodman,

Thanks a lot!

Hopefully that will be enough to get me going. Sounds like we are in a similar place right now. :)

Best,

\ ^ / i l l

RockfordLhotka replied on Monday, February 14, 2011

CyclingFoodmanPA

I would hope that ProjectTracker would be updated to reflect all current stuff because that is the most realistic business type application to date.

This is one of the big challenges, and reasons why I've been doing smaller/simpler samples lately.

Personally I generally prefer what I'm calling the encapsulated invoke data access model in the Using CSLA 4: Data Access ebook. So when I do update ProjectTracker that's the model I'll almost certainly be using.

Because there are non-trivial code differences to use the factory implementation model (my second favorite), I can't do this in the same implementation of ProjectTracker.

In other words, I'd need to maintain ProjectTracker twice (4 times if you count C# and VB) to show both of the primary DAL models. That's not going to happen - I just don't have the time to do that.

So I am building targeted samples for the Data Access ebook to show both models (with some other variants). And I'll update ProjectTracker when I write the WPF/Silverlight ebook in March - that's my plan anyway.

JCardina replied on Monday, February 14, 2011

If it doesn't work in the 4.1 examples archive it should be removed.

frankhoffy replied on Wednesday, February 16, 2011

To save yourself some trouble, I would dump the VB.NET version of the sample and point people to tools like http://www.developerfusion.com/tools/convert/csharp-to-vb/.  I've used this conversion tool many times with a lot of success.

Copyright (c) Marimer LLC