The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Very, very, very strange problem... (cached data???)

Last post 08-14-2008, 3:27 AM by rotep. 2 replies.
Sort Posts: Previous Next
  •  08-14-2008, 2:25 AM 10740

    Very, very, very strange problem... (cached data???)

    Hi guys, I'm running into some very strange (possible caching) problems... See comments in codefragment below...

    I've had the same problem yesterday... I delete a row directly in the database, but EntitySpaces keeps loading it somehow??

    Code:
    Dim w As New EC.BLL.WoOperation
    Dim workorderPlan As BLL.EpPlan
    Dim workorderPlanQuery As BLL.EpPlanQuery
    Dim workorderPlanCollection As BLL.EpPlanCollection
    
    If w.LoadByPrimaryKey(WooKey) Then
        'Values are added here...
        workorderPlan.Save()
        'Loaded again because primary key is not filled automatically
        workorderPlanCollection = New BLL.EpPlanCollection
        workorderPlanQuery = New BLL.EpPlanQuery
        workorderPlanQuery.Where(workorderPlanQuery.WooKey.Equal(w.WooKey))
        workorderPlanCollection.Load(workorderPlanQuery)
        'The following Select statement goes to Is > 1 case, workorderPlanCollection.Count seems to be 26????? I've just removed ALL records and it's still 26!!!!
        Select Case workorderPlanCollection.Count
            Case 0
        'insert failed
            Case 1
                workorderPlan = workorderPlanCollection(0)
            Case Is > 1
        'I've looped through the collection and MsgBoxed the primary key, it starts with 51 and goes up to some 100 or 200 values, but the sequence is at 4100 at the moment when inserting a new row???!?!??!
        End Select
    
    End If
  •  08-14-2008, 2:49 AM 10742 in reply to 10740

    Re: Very, very, very strange problem... (cached data???)

    Maybe the fragment above isn't all that clear, I've made another piece of testing code in a new solution which produces the same results:

    Directly in database console: Select Count(*) From Ep_Plan -> returns 0 (obviously after a Delete From Ep_Plan)

    The following code however produces hundreds of messageboxes??

    Code:
    Public Sub CountPlans()
        Dim pColl As New BLL.EpPlanCollection
        pColl.LoadAll()
    
        For Each p As BLL.EpPlan In pColl
            MsgBox(p.EppAutoKey)
        Next
    End Sub
  •  08-14-2008, 3:27 AM 10743 in reply to 10742

    Re: Very, very, very strange problem... (cached data???)

    Sorry guys, the problem seems to be on our side here....
View as RSS news feed in XML