ORmEntityOutOfSyncException - Fetching Entity

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 03-Mar-2006 17:49:48   

From what I read, ORmEntityOutOfSyncException is generated when a saved entity is read without a refetch...

However, I'm getting this error when I'm using the command FetchEntityUsingUniqueConstraint.

Here is my code:

        Dim _User As EntityClasses.SEZUserEntity = New EntityClasses.SEZUserEntity

        Dim _Filter As PredicateExpression = New PredicateExpression
        _Filter.Add(FactoryClasses.PredicateFactory.CompareValue(UserFieldIndex.Deleted, ComparisonOperator.Equal, False))
        _Filter.AddWithAnd(FactoryClasses.PredicateFactory.CompareValue(UserFieldIndex.Username, ComparisonOperator.Equal, Username))
        _Filter.AddWithAnd(FactoryClasses.PredicateFactory.CompareValue(UserFieldIndex.Password, ComparisonOperator.Equal, Password))

        'Adapter.FetchEntityUsingUniqueConstraint(_User, _Filter, PrefetchPath)
        Adapter.FetchEntityUsingUniqueConstraint(_User, _Filter)

        Return _User

Anyone know why it'll return a outofSync immediately?

Thanks.

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 03-Mar-2006 18:53:27   

Solved... simple_smile It's working now... but dunno why...

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 03-Mar-2006 19:14:32   

If the fetch fails, as I just learned....

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5527