Databases Reference
In-Depth Information
" Salary: " + dataReader.GetInt32(2));
}
System.Console.WriteLine();
// Close the DataReader
dataReader.Close();
}
finally {
dataReader.Close();
cmd.Dispose();
}
See “Managing Commits in Transactions,” page 22, for information on when
to commit work if you've turned off auto-commit mode.
Choosing the Right Transaction Model
Which type of transaction should you use: local or distributed? A local transac-
tion accesses and updates data on a single database. A distributed transaction
accesses and updates data on multiple databases; therefore, it must be coordi-
nated among those databases.
Performance Tip
Distributed transactions are substantially slower than local transactions
because of the logging and network round trips needed to communicate
between all the components involved in the distributed transaction.
Unless distributed transactions are required, you should use local trans-
actions.
In .NET Framework 2.0, the System.Transactions namespace manages
transactions. The best way to determine if your application is using distributed
transactions is to look for the following line of code and examine the code that
follows:
using System.Transactions;
 
Search WWH ::




Custom Search