<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx</link><description>The simplest way to use transactions today with Microsoft SQL Server 2000, using .Net Framework 2.0, is as follows: static void Main(string[] args) { using (TransactionScope ts = new TransactionScope()) { SqlConnection sqlConnection = new SqlConnection("connectionString");</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#476196</link><pubDate>Sun, 02 Oct 2005 15:30:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:476196</guid><dc:creator>Sami</dc:creator><description>Hello Florin,&lt;br&gt;Im trying to get the PDC dlinq samples work with TransactionScope object, the idea is to build a case study showing the whole Indigo+tx flow+dlinq thing. But it seems that the bits provided with dlink are only targeting Sql 2005 Express Edition. When I run this code with Sql 2000, MsDTC always rollback the current transaction with no message.&lt;br&gt;&lt;br&gt;// AFTER&lt;br&gt;            ObjectDumper.Write(from p in db.Products where p.ProductID == 4 select p);&lt;br&gt;            ObjectDumper.Write(from p in db.Products where p.ProductID == 5 select p);&lt;br&gt;&lt;br&gt;Display the correct row data, but the table is not consistent with this message. &lt;br&gt;&lt;br&gt;Any idea?&lt;br&gt;&lt;br&gt; </description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#476206</link><pubDate>Sun, 02 Oct 2005 17:03:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:476206</guid><dc:creator>Sami</dc:creator><description>Ok I found the problem. PDC Dlinq samples don't work because they lack of ts.Complete() statement.&lt;br&gt; </description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#479734</link><pubDate>Tue, 11 Oct 2005 21:38:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:479734</guid><dc:creator>Vikas Jindal</dc:creator><description>Really Fantastic</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#504005</link><pubDate>Thu, 15 Dec 2005 11:58:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:504005</guid><dc:creator>Tomas Carlsson</dc:creator><description>Hello, &lt;br&gt;Thank you fore a good artickle. &lt;br&gt;I would like to make a distributed transaction over two databases (and be able to role back if anything goes wrong). &lt;br&gt;&lt;br&gt;Is this possible with SQL Server 2000 and this pattern? I don't like to &amp;quot;mess up&amp;quot; my code with EnterproceServices and COM+. &lt;br&gt;&lt;br&gt;I have tried to modify your code-example with two connections but I get an exeption that says &amp;quot;Cannot enlist in a distributed transaction&amp;quot;, se my code below. What am I doing wrong? &lt;br&gt;&lt;br&gt;Thank you for helping me ;) &lt;br&gt;&lt;br&gt;Tomas &lt;br&gt;&lt;br&gt;&lt;br&gt;string connStrAar1Reg1 = GemFunktioner.AnslutningAarRegion(AAR_1); &lt;br&gt;connStrAar1Reg1 += &amp;quot;Enlist=false&amp;quot;; &lt;br&gt;m_connAar1 = new SqlConnection(connStrAar1Reg1); &lt;br&gt;m_dbAdapterAar1 = new DatabaseTransactionAdapter(m_connAar1); &lt;br&gt;m_connAar1.Open(); &lt;br&gt;&lt;br&gt;string connStrAar2Reg1 = GemFunktioner.AnslutningAarRegion(AAR_2); &lt;br&gt;connStrAar2Reg1 += &amp;quot;Enlist=false&amp;quot;; &lt;br&gt;m_connAar2 = new SqlConnection(connStrAar2Reg1); &lt;br&gt;m_dbAdapterAar2 = new DatabaseTransactionAdapter(m_connAar2); &lt;br&gt;m_connAar2.Open(); &lt;br&gt;&lt;br&gt;m_dbAdapterAar1.Begin(); &lt;br&gt;m_dbAdapterAar2.Begin(); // Here I get the exeption &amp;quot;Cannot enlist in a distributed transaction&amp;quot;</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#520277</link><pubDate>Tue, 31 Jan 2006 10:57:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:520277</guid><dc:creator>florinlazar</dc:creator><description>To: Tomas Carlsson&lt;br/&gt;Tomas, when you have 2 database connections, you don't have to use this adapter, since you can't avoid using the DTC transaction in this scenario. Simply use the normal pattern for TransactionScope and you will be all set.</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#521828</link><pubDate>Wed, 01 Feb 2006 16:04:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:521828</guid><dc:creator>Rob Steele</dc:creator><description>Will this pattern work with Oracle 9.x or 10.x?  Are you aware of any issues? I am utilizing the ODP.Net provided by Oracle.</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#522237</link><pubDate>Wed, 01 Feb 2006 21:09:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:522237</guid><dc:creator>florinlazar</dc:creator><description>To: Rob Steele&lt;br/&gt;&lt;br/&gt;If Oracle supports internal transactions, you should be able to change the adapter to work with ODP.Net.</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#556091</link><pubDate>Tue, 21 Mar 2006 03:12:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:556091</guid><dc:creator>Richard Purchas</dc:creator><description>I tried John Doty's sample TransactionAdapter with mixed results:&lt;br&gt;- where I had transactions that mixed TransactionScopeOption.Required with TransactionScopeOption.Suppress operations, the adapter doesn't support transactions operating in TransactionScopeOption.Suppress mode. I changed all of these instances to use TransactionScopeOption.Required and that seemed to keep it happy.&lt;br&gt;&lt;br&gt;- next, I started getting errors when running transactions that involved the work of multiple data components, where each data component would (a) connect to the database and then (b) do some work.&lt;br&gt;&lt;br&gt;In this last case, it was trying to enlist the current transaction more than once (and hence failed). Also, I could see from the SQL 2000 trace that when each data component created a connection a NEW connection was being created rather than some resource dispenser detectng that a transaction was active and re-using the current transaction.&lt;br&gt;&lt;br&gt;My sole reasons for wanting to use John's example was to eliminate the need for the MSDTC on this single-database SQL 2000 application (as use of the MSDTC violates my client's corporate security policies, and it is not great for performance reasons either).&lt;br&gt;&lt;br&gt;Looks like I'll need to hunt around for another solution (unless anyone else has resolved this problem already ??).</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#575919</link><pubDate>Thu, 13 Apr 2006 21:21:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:575919</guid><dc:creator>Joe Egan</dc:creator><description>...perfect solution as I migrate to CSLA .NET 2.0 but stick with SQL Server 2000 for a while. &amp;nbsp;Thanks!</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#605272</link><pubDate>Wed, 24 May 2006 00:34:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:605272</guid><dc:creator>Javed</dc:creator><description>I am having difficulty getting the DataBaseTransactionAdapter to work.  It was easy enough to use.  Everything seems to go smoothly but when the routine exits, I get an exception "Transaction was aborted".  I do indeed call ts.Complete right after .ExecuteNonQuery.  The method executes without problem, but back in the calling routine the Try...Catch block shows up with the about exception.
</description></item><item><title>Using msmq and sql</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#655030</link><pubDate>Mon, 03 Jul 2006 09:26:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:655030</guid><dc:creator>Avi_H</dc:creator><description>Could you please post a sample for it ? &lt;br&gt;&lt;br&gt;Thanks</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#685035</link><pubDate>Tue, 01 Aug 2006 11:52:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:685035</guid><dc:creator>Fyodor Sheremetyev</dc:creator><description>To: Richard Purchas
Have you found any other solution?</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#740959</link><pubDate>Tue, 05 Sep 2006 14:03:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:740959</guid><dc:creator>Steve Phillips</dc:creator><description>Florin,

The reason you have to set the transaction manually is because the SqlConnection object has been explicitly excluded from it using the "EnList=false" parameter.</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#744602</link><pubDate>Thu, 07 Sep 2006 19:07:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:744602</guid><dc:creator>Liviu Uba</dc:creator><description>Excelent. 
I struggle with Transactions and Dataset designer generated datasets for a while, and I have only headaches...

DatabaseTransactionalAdapter is just awesome.

I have written a small wrapper for the DataTableAdapters generated by Dataset Designer:

Adapter&lt;T&gt; with implicit conversion to T where T si DataTableAdapter. the reason: setting of the transaction:

DatabaseTransactionAdapter dta = new DatabaseTransactionAdapter(conn);

PersonTableAdapter p1 = new Adapter&lt;PersonTableAdapter&gt;(dta.Transaction);

excellent!!!!!</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#749514</link><pubDate>Mon, 11 Sep 2006 17:37:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:749514</guid><dc:creator>Liviu Uba</dc:creator><description>Thanx. My previous post did not show up, but anyway I want to thank you, because based on your adapter and custom code generation that extends the dataset designer code I can write now following and it rocks!! :

Data data = new Data();
using (Db.ReadCommitted)
{
  data.Document.GetDataById(5456454, 1);
  data.Document.DataRows(0).FreeTxt = Guid.NewGuid();
  data.Document.Save();
  Db.Commit();
}
</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#783789</link><pubDate>Tue, 03 Oct 2006 06:46:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:783789</guid><dc:creator>Manoj</dc:creator><description>I tried to use the TransactionAdapter with the following test code. The code fails at the adapter.Begin() inside the TxnInner method below. However, if I use TransactionScopeOption RequiresNew for inner transaction the code works winhout problem.

using System;
using System.Data;
using System.Transactions;
using System.Data.SqlClient;

namespace Test
{
    public class TxnTest
    {
        const string connectionString = ".......;enlist=false";
        const string sql = "select * from authors";

        private static void TxnInner()
        {
            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
            {
                SqlConnection connection = new SqlConnection(connectionString);
                connection.Open();
                SqlCommand command = new SqlCommand(sql, connection);


                DatabaseTransactionAdapter adapter = new DatabaseTransactionAdapter(connection);
                adapter.Begin();// Fails here if TransactionScopeOption is Required
                command.Transaction = (SqlTransaction)adapter.Transaction;

                command.ExecuteNonQuery();

                scope.Complete();
            }
        }

        public static void TxnOuter()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                SqlConnection connection = new SqlConnection(connectionString);
                connection.Open();
                DatabaseTransactionAdapter adapter = new DatabaseTransactionAdapter(connection);

                SqlCommand command = new SqlCommand(sql, connection);

                adapter.Begin();
                command.Transaction = (SqlTransaction)adapter.Transaction;
                command.ExecuteNonQuery();

                TxnInner();

                scope.Complete();
            }
        }

        public static void DoTest()
        {
            TxnOuter();
        }
    }
}</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#788062</link><pubDate>Wed, 04 Oct 2006 02:18:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:788062</guid><dc:creator>florinlazar</dc:creator><description>&lt;p&gt;To: Richard Purchas&lt;/p&gt;
&lt;p&gt;For reusing the connection, you might also take a look at the ConnectionScope class posted at &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/dataaccess/archive/2006/02/14/532026.aspx"&gt;http://blogs.msdn.com/dataaccess/archive/2006/02/14/532026.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>An error occurred while enlisting in a distributed transaction</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#7209321</link><pubDate>Wed, 23 Jan 2008 18:03:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7209321</guid><dc:creator>Muralidhar</dc:creator><description>&lt;p&gt;I hav a diff problem. Am using 1.1 with sql server 2000 and Auto enlisting. Transactions are implemented thru Enterprise components. &lt;/p&gt;
&lt;p&gt;At regular intervals I am getting &amp;quot;An error occurred while enlisting in a distributed transaction&amp;quot; error. And when I run the same activity agains it succeds without any error..&lt;/p&gt;
&lt;p&gt;Can u show some thoght into this.. Thanks&lt;/p&gt;</description></item><item><title>re: Fast transactions with System.Transactions and Microsoft SQL Server 2000</title><link>http://blogs.msdn.com/florinlazar/archive/2005/09/29/fast-transactions-with-system-transactions-and-microsoft-sql-server-2000.aspx#7211597</link><pubDate>Wed, 23 Jan 2008 21:58:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7211597</guid><dc:creator>florinlazar</dc:creator><description>&lt;p&gt;To: Muralidhar&lt;/p&gt;
&lt;p&gt;For this sort of issues, I recommend posting at the Transactions Forum at &lt;a rel="nofollow" target="_new" href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=388&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=388&amp;amp;SiteID=1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or if it is critical for your business, you should contact Microsoft Support.&lt;/p&gt;
</description></item></channel></rss>