Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
我用的是托管空间,使用NBear会不会遇到不能解决的问题
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
hewei  
View profile   Translate to Translated (View Original)
 More options Dec 11 2006, 10:35 pm
From: "hewei" <heweit...@gmail.com>
Date: Mon, 11 Dec 2006 19:35:06 -0800
Local: Mon, Dec 11 2006 10:35 pm
Subject: 我用的是托管空间,使用NBear会不会遇到不能解决的问题
如题!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teddy  
View profile   Translate to Translated (View Original)
 More options Dec 11 2006, 10:47 pm
From: Teddy <shijie...@gmail.com>
Date: Tue, 12 Dec 2006 11:47:24 +0800
Local: Mon, Dec 11 2006 10:47 pm
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题

不会,但是,用于托管空间的话,要注意一点:对于每一个写操作,必须显式使用Gateway.BeginTransaction
()方式的事务,并在传递tran参数,否则会报msdtc服务未开启错误。

例如,Save操作必须象下面这样执行:

DbTransaction tran = Gateway.BeginTransaction();
try
{
  gateway.Save(entityObj, tran);

  tran.Commit();

}

catch
{
  tran.Rollback();
  throw;
}

finally
{
  gateway.CloseTransaction(tran);

}

On 12/12/06, hewei <heweit...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
辉郎  
View profile   Translate to Translated (View Original)
 More options Dec 12 2006, 12:28 am
From: "辉郎" <smart.wol...@gmail.com>
Date: Mon, 11 Dec 2006 21:28:56 -0800
Local: Tues, Dec 12 2006 12:28 am
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题
那请问,我没有用到数据库写操作,所以我也没有调用事务,怎么还要报dtc未开启的错误呢,最后我开了dtc后才ok了

"Teddy 写道:
"


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teddy  
View profile   Translate to Translated (View Original)
 More options Dec 12 2006, 12:40 am
From: Teddy <shijie...@gmail.com>
Date: Tue, 12 Dec 2006 13:40:02 +0800
Local: Tues, Dec 12 2006 12:40 am
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题

to 辉郎:

如果报msdtc错误,那么你肯定用到写操作了。可能你没有留意。因为,不用写操作,不会触发对TransactionScope的调用的,也就不可能报这个错 误。

Teddy

On 12/12/06, 辉郎 <smart.wol...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MK2  
View profile  
 More options Dec 12 2006, 3:45 pm
From: "MK2" <feng...@gmail.com>
Date: Tue, 12 Dec 2006 20:45:37 -0000
Local: Tues, Dec 12 2006 3:45 pm
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题
using (DbTransaction tran = gateway.BeginTransaction())
            {
                .......
            }

这样是否效果也等同于gateway.CloseTransaction(tran); 呢?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teddy  
View profile   Translate to Translated (View Original)
 More options Dec 12 2006, 8:04 pm
From: Teddy <shijie...@gmail.com>
Date: Wed, 13 Dec 2006 09:04:51 +0800
Local: Tues, Dec 12 2006 8:04 pm
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题

不等同!必须try catch。

On 12/13/06, MK2 <feng...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hewei  
View profile   Translate to Translated (View Original)
 More options Dec 19 2006, 1:09 am
From: "hewei" <heweit...@gmail.com>
Date: Mon, 18 Dec 2006 22:09:30 -0800
Local: Tues, Dec 19 2006 1:09 am
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题
为什么必须try catch

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teddy  
View profile   Translate to Translated (View Original)
 More options Dec 19 2006, 1:11 am
From: Teddy <shijie...@gmail.com>
Date: Tue, 19 Dec 2006 14:11:28 +0800
Local: Tues, Dec 19 2006 1:11 am
Subject: Re: 我用的是托管空间,使用NBear会不会遇到不能解决的问题

不使用try catch
finally就不能保证在finally中Close这个Transaction,tran不close它关联的connection也就不会close,它 的资源就会一直被占用。

On 12/19/06, hewei <heweit...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google