Guys, help!

I've been trying to use DO v4 in ASP.NET enviroment. I use your SessionManager under the example. It works good untill I try to insert or update some objects. If I simply change properties of objects, it doesn't change data at all. If I use ValidationDisable() region, data is changed, but transactions aren't commited, DB is locked. I can see these changes cause I set IsolationLevel = ReadUncommeted. But of cource I loose them later.


Updated at 29.10.2009 14:26:44

Well, I found a way. System.Transactions.TransactionScope - why I didn't think about it at the beginning?

Hm... Doesn't work. Why such simple operation is so extremely hard?


Updated at 29.10.2009 15:26:09

Yes, it works :( I must be stupid :evil:


Updated at 29.10.2009 15:48:38

Are you using the following pattern? using (var ts = Transaction.Open()) { ... // your code here ts.Complete(); <-- Is required to commit the transaction }

Of cource I tried. Doesn't help.

By default SessionManager commits each transaction it creates, if no error (I mean ASP.NET error) has occurred (or you must set its HasError property to true to prevent the commit).

I call Response.Redirect() at the end, is it ok?

So... Can you give us some example code you're using? SQL Profiler output or debug log (just run the app. in Debug mode & see Debug Output window in VS.NET) would also be helpful. We're writing the manual now, so any unexpected issues are actually must be either covered or fixed ASAP...

Debug Output window is empty. I'll try to post SQL Profiler output. Btw, it would be much easy to analyze SQL Profiler output having set application name in connection string. Is it possible?

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by buck.

asked Oct 29 '09 at 13:03

Editor's gravatar image

Editor
46154156157

Alex Kofman wrote: Please run our ASP.NET sample... Does it work?

(Oct 29 '09 at 13:03) Editor Editor's gravatar image

Hello buck,

Are you using the following pattern?

using (var ts = Transaction.Open()) {

... // your code here

ts.Complete(); <-- Is required to commit the transaction }

(Oct 29 '09 at 13:03) Dmitri Maximov Dmitri%20Maximov's gravatar image

One Answer:

By default SessionManager commits each transaction it creates, if no error (I mean ASP.NET error) has occurred (or you must set its HasError property to true to prevent the commit).

So... Can you give us some example code you're using? SQL Profiler output or debug log (just run the app. in Debug mode & see Debug Output window in VS.NET) would also be helpful. We're writing the manual now, so any unexpected issues must be either covered there or fixed ASAP...


> I call Response.Redirect() at the end, is it ok?

I'm not sure. Guys @ Xtensive, can you check this?

> Debug Output window is empty.

That's really strange... If you're running the app. under debugger, we redirect all log messages to Debug Output window, if you don't redirect them explicitly in Web.config.

Anyway, details about logging are here: http://blog.alexyakunin.com/2009/10/v41 ... ching.html

> Btw, it would be much easy to analyze SQL Profiler output having set application name in connection string. Is it possible?

Yes, you can add any additional parameters to connection string via connection URL by this way: mssql://...&key1=value1&key2=value2[&...]

Note that their content must be URL-encoded.

answered Oct 29 '09 at 15:26

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

NP, it seems that this pattern is no so obvious in usage as it was expected.

Anyway, thanks for your patience. Don't mind to bother us ;)

(Oct 29 '09 at 15:26) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×573

Asked: Oct 29 '09 at 13:03

Seen: 1,967 times

Last updated: Oct 29 '09 at 13:03

powered by OSQA