BO IsDirty set to false after failed save


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
When faced with something like this.  The best advice that I have, especially since you are pretty confident on how to reproduce, is to post a simple sample that reproduces the behavior.  This way we can logically step through this and know that we are setting up the test the same as you.  WHen we do this, we come to resolutions much faster than going back and forth via forum posts.
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
I was finally able to recreate the problem I was having. But before I send the whole sample, I figured I'd show this code where the last change that was made caused the problem.



The problem started when I added the rollback command after if (result != SaveUndoResult.Success). I know it doesn't make much sense to have it there because no database changes are made at that point, but I don't think it should be causing problems like this.



I'll post the sample in a few minutes



protected void btnPostBack_Click(object sender, EventArgs e)

{

try

{

BusinessLayer.TransactionBegin("", IsolationLevel.ReadCommitted);



SaveUndoResult result = MyParent.Save(true);

if (result != SaveUndoResult.Success)

{

BusinessLayer.TransactionRollback("");

}

else

{

BusinessLayer.TransactionCommit("");

}

lblMessage.Text = result.ToString();

}

catch

{



BusinessLayer.TransactionRollback("");

}

finally

{



}

}

Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
here is the sample project and data
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
I will probably just remove that rollback command
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Looks like I spoke too soon. I can't just remove the command to Rollback the transaction because the second time the submit button is clicked the transaction is still active and calling the BeginTransaction command causes the following exception "A transaction with the key [DEF_TRANS_KEY] is already started".



So I tried calling Commit instead and that seems too work.



I don't think this is the greatest behavior when dealing with transactions, because I should be able to call the RollbackTransaction method where I was calling it. Are the developers looking into this? If so, do you need anything else from me?
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Trent,



Do you think my solution is appropriate or is this something that needs to be fixed in Strataframe?



Thank You,

Govinda
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I am sorry I have not yet responded to this post.  I have not had a chance to look at it.   Everything came flying at me all at the same time.  We have been dealing with some server issues as well as some strange forum posts lately which has slowed down the "pipe."  We still have this on the stack to look at.  Sorry for the wait.
Govinda Berrio
Govinda Berrio
StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)StrataFrame User (204 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Thanks for the update.



While I'm here, I'll add that when running the sample probject, you'll see the behavior by filling only one of the fields and hitting submit twice, the first time you should see AbortedWithBrokenRules and the second time Success.



Thanks again
Chan
Chan
Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)Advanced StrataFrame User (603 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Any update?



Thank you
Ertan Deniz
Ertan Deniz
StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)
Group: Forum Members
Posts: 163, Visits: 493
I have the same problem as well.

Submit twice for save button,

First save operation, I 've got normally AbortedWithBrokenRules,

But Second save, I've got Success. (This is wrong. The return value have to be AbortedWithBrokenRules)

What is going wrong ?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search