<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Data Access and ObjectDataSource Control</title><link>http://forums.asp.net/23.aspx</link><description>Questions and discussions related to using ADO.NET for data access, and the ObjectDataSource control. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=9&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Rollback using Entity framework</title><link>http://forums.asp.net/thread/3283718.aspx</link><pubDate>Thu, 09 Jul 2009 13:04:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3283718</guid><dc:creator>zeeshanfawad</dc:creator><author>zeeshanfawad</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3283718.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3283718</wfw:commentRss><description>&lt;p&gt;Hello Sir,&lt;/p&gt;&lt;p&gt;I&amp;#39;ve solved rollback issue. But i am getting another exception while making transactions on Network. Description is given below:&lt;/p&gt;&lt;p&gt;&amp;quot;&lt;br /&gt;I am finding a problem in Transaction scope&amp;nbsp; using entity framework. I&amp;#39;ve also started DTC services in windows services. It gives me Exception that &amp;quot;The underlying provider failed on Open.&amp;quot;.&amp;nbsp; My inner exception detail is given below:&lt;br /&gt;&lt;br /&gt;{&amp;quot;Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.&amp;quot;}&lt;br /&gt;&lt;br /&gt;{&amp;quot;The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)&amp;quot;}&lt;br /&gt;&lt;br /&gt;When i deploy my database on my own client machine it works properly. But when i deploy my data base on another machine. Then Transactionscope gives me error. Can anyone help me regarding this issue. Its very urgent. Waiting for quick response.&amp;quot;&lt;/p&gt;</description></item><item><title>Re: Rollback using Entity framework</title><link>http://forums.asp.net/thread/3237440.aspx</link><pubDate>Tue, 16 Jun 2009 15:40:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3237440</guid><dc:creator>docluv</dc:creator><author>docluv</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3237440.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3237440</wfw:commentRss><description>&lt;font face="Times New Roman"&gt;Transactions are automatically managed within the same object context by the Entity Framework Object Services. This includes multiple operations that are dependent on successful completion of queries or transactions that depend on distributed systems, such as e-mail or MSMQ. Entity Framework operations can be executed within a &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;System.Transactions&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;Transaction&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; to ensure the requirements are met.&lt;/font&gt;&lt;font face="Times New Roman"&gt;The use of transactions and Object Services requires the following considerations: only operations against the data source are transacted, &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;SaveChanges&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; will use any existing transaction to perform the operation, if none exist it will create one. Changes to objects in the object context are not accepted until the entire transaction is complete. If you retry an operation within a transaction the &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;SaveChanges&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; method should be called with a &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;acceptChangesDuringSave&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; set to false, then call &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;AcceptAllChanges&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; after the transaction operations have completed. Avoid calling &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;SaveChanges&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; after calling &lt;/font&gt;&lt;span class="CodeinText"&gt;&lt;span style="FONT-SIZE:9.5pt;mso-bidi-font-size:10.0pt;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;font face="Courier New"&gt;AcceptAllChanges&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt;, this will cause the context to reapply all the changes to the data source.&lt;/font&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Rollback using Entity framework</title><link>http://forums.asp.net/thread/3236604.aspx</link><pubDate>Tue, 16 Jun 2009 10:25:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3236604</guid><dc:creator>zeeshanfawad</dc:creator><author>zeeshanfawad</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3236604.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3236604</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello Friends,&lt;br /&gt;
How are you?? I am facing problem in ADO.NET entity framework. I want
to impliment Rollback functionality using Entity frameowrk. I am trying
to insert record in multiple tables in one transaction using&amp;nbsp; different
contexts. My application scenario is given below:&lt;br /&gt;
&lt;br /&gt;
EntityContainer ec = new EntityContainer();&lt;br /&gt;
//Make Entity Object&lt;br /&gt;
//Set all values of Entity and Call ec.AddToEntity() object&lt;br /&gt;
//Call: ec.SaveChanges();&lt;br /&gt;
//Make New Method for Other Entity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; --Make New Entity Container object by name ec2.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; --Set all values of Entity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; --and then SaveChanges of ec2&lt;br /&gt;
Now i&amp;#39;ve problem when ec1 successfully updated the value and if ec2
fails to Save values in table. Then all values from ec1 should also be
Rollback. I am try to solve it by using &amp;quot;TransactionScope()&amp;quot; but it
faiuls to commit changes. Code snippest is given below:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (TransactionScope ts = new TransactionScope())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ec1.AddToEntity(newObj);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ec1.SaveChanges();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddEntity2();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Complete();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
 AddEntity2()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Code for ec2 operations&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ec2.SaveChanges();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
When it call ts.complete then it gives exception that: &amp;quot;&lt;b&gt;The transaction has aborted&lt;/b&gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Can anyone help us that how i can solve this issue??&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;</description></item></channel></rss>