exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 106 discussion

Actual exam question from Microsoft's 70-487
Question #: 106
Topic #: 1
[All 70-487 Questions]

HOTSPOT -
You are developing an ASP.NET Web API to process customer and product data that is stored in separate Azure SQL Database instances. The API will use the latest versions of the .NET Framework and ADO.NET to access and modify data.
Connection stings for the customer and product databases are stored in string variables named connectionStringCustomers and connectionStringProducts, respectively. The API must elastic database transactions.
You need to implement the distributed transaction.
How should you complete the code? To answer, select the appropriate options in the answer area.
Each correct selection is worth one point.
NOTE:
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References:
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/distributed-transactions

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
Highly Voted 5 years, 5 months ago
1: new SqlConnection(connectionStringProducts) 2: .open() 3: new Sq;lConnection(connectionStringCustomers) 4: .open() https://docs.microsoft.com/en-us/dotnet/api/system.transactions.transactionscope?view=netframework-4.8
upvoted 35 times
...
bobtables
Highly Voted 5 years, 7 months ago
Pretty sure this is wrong... https://docs.microsoft.com/en-us/dotnet/framework/data/transactions/implementing-an-implicit-transaction-using-transaction-scope
upvoted 10 times
bobtables
5 years, 7 months ago
The 2nd and 4th blanks should be "Open()"
upvoted 27 times
LeonWang
5 years, 5 months ago
Totally agree. With Ado.Net 2, connection is auto enlist when open if it is in the translation already.
upvoted 5 times
...
mfg41
5 years, 4 months ago
I agree. https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.enlistdistributedtransaction?view=netframework-4.8
upvoted 3 times
...
...
mmk1991
5 years, 3 months ago
Agree, according to this: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-elastic-transactions-overview
upvoted 4 times
...
...
namalum
Most Recent 4 years, 5 months ago
Answer is wrong Similar scenario at this anchored link https://docs.microsoft.com/en-us/azure/azure-sql/database/elastic-transactions-overview#multi-database-applications
upvoted 1 times
...
pragatwagledev
4 years, 6 months ago
You have to open the connection, that transaction scope creates a scope for that transaction, and the the distribution for that transaction is within the scope defined. But you always have to open the connection, and the scope is defined in the above using statement.
upvoted 1 times
...
kvijen
4 years, 7 months ago
1. new SqlConnection(connectionstringProducts) 2. Open 3. new SqlConnection(connectionStringCustomers) 4. Open https://docs.microsoft.com/en-us/dotnet/framework/data/transactions/implementing-an-implicit-transaction-using-transaction-scope#creating-a-transaction-scope
upvoted 3 times
...
zimzimzimma
4 years, 9 months ago
Some of the 'official answers' are really a joke.
upvoted 1 times
...
applepie
4 years, 10 months ago
The answer is wrong, check the example here: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/system-transactions-integration-with-sql-server
upvoted 1 times
...
hollanjs
4 years, 10 months ago
The answer is wrong 2 and 4 should be open() - the code this question is referencing can be found in Microsoft's Elastic Transactions Overview, pretty much verbatim: https://docs.microsoft.com/en-us/azure/azure-sql/database/elastic-transactions-overview#multi-database-applications
upvoted 4 times
...
MaverickCalibre
5 years, 6 months ago
Answer is correct and as per the supporting link provided. "Automatic enlistment is the default (and preferred) way of integrating ADO.NET connections with System.Transactions. A connection object will automatically enlist in an existing distributed transaction if it determines that a transaction is active, which, in System.Transaction terms, means that Transaction.Current is not null. Automatic transaction enlistment occurs when the connection is opened."
upvoted 6 times
Sanfour
4 years, 11 months ago
"Automatic transaction enlistment occurs when the connection is opened." The connection has not been opened yet
upvoted 3 times
...
Abou_riyad
4 years, 5 months ago
It's obvious in the text that you don't need to add EnlistDistributedTransaction "Automatic enlistment is the default..". So no need to add EnlistDistributedTransaction, .open instead
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...