asp.net - Flush separate Castle ActiveRecord Transaction, and refresh object in another Transaction -


All of my ASP.NET requests are wrapped in a session and a transaction that is committed only at the very end. At some point during execution, I would like to insert an object and make it visible to other potential threads - that is to split the inclusion in a new transaction, commit that transaction and move on.

The reason for this is that the request in question hits an API, after which to hit me on any other page in the series (near-synchronous) to tell me that it is processed , And thus two transaction records because the original request was not yet finished, and thus the transaction was not recorded.

So I tried to wrap the entry code with the combination of both a new session scope, transaction scope (transaction mode), everything was manually slipped, etc.

However, when I refresh the object, I am still getting the old object state.

Here I am looking for the OD sample:

  post out post = post. Search (ID); // This post has a status status. Using (Transaction Scope Transactions = New Transaction Schemes (TransactionMode.New) {Post P = Post.Fund (ID); P. Condition = condition. new; // Set new position p.Update (); SessionScope.Current.Flush (); Transaction.Flush (); Transaction.VoteCommit (); } Outpost. Refresh (); 

P>

I have a similar problem, the default isolation level related to the level of isolation was set to "snapshots", and when SQL It was running on the server, this meant that the first transaction would not appear anything that changed after the start. Maybe it's your isolation level?

If not, try to make a new transaction scope directly after disposing one of the above, and see if you can read it in new form. If you can not do this, then possibly there is nothing to do with outside transactions.

Hope that helps.

Marcus


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -