Problem with recrusive saves

Posts   
 
    
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 09-Jul-2007 18:34:51   

Dears at the forum,

I fetch an entity from the db and add a new member to one of its depending collections. I try to save the entity using the following code:


Me.Adapter.KeepConnectionOpen = True
Me.Adapter.StartTransaction(IsolationLevel.ReadUncommitted, "BFBaseTransaction")

uow.AddForSave(Entity, Nothing, False, Recrusive)


As you see, I put the refetch parameter to false since I do the refetching on my own later on.

Looking at the SQL Profiler I see the following: - An Insert statement is generated and run against the server for the new Entity (trying the statement in the QA shows that is does the insert) - The complete graph is refetched - A rollback is performed - An update statement is performed for the Main entity (without a transaction) - the last update goes through

Here are some of the details: - I am using LLBLGen 2.0 - I check the state of the new entity I am just added to the main entity and


Entity.Fields.State = EntityState.New

I am a bit puzzeled by this behavior, I haven't seen it as of yet.

Could some one please make a suggestion as to how to proceed trying to find the error?

Best regards

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Jul-2007 02:36:09   

Hi eugene. Please provide real code as I'm not clear about where and what is exactly the problem. wink thanks

David Elizondo | LLBLGen Support Team
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 11-Jul-2007 15:44:48   

Hi there,

well it turns out the validation routine called by SaveEntity was calling Rollback during validation. Thank you for the prompt reply!

Greetings