No TransactionScope for DataPortal_Fetch?

No TransactionScope for DataPortal_Fetch?

Old forum URL: forums.lhotka.net/forums/t/4140.aspx


Flatulus posted on Wednesday, January 09, 2008

Hello

Just curious about something... in the Project Tracker sample application (in Project.cs), why does most of the DataPortal_XXX methods have the [Transactional(TransactionalTypes.TransactionScope)] attribute but DataPortal_Fetch doesn't?

Thanks

JoeFallon1 replied on Wednesday, January 09, 2008

The main reason is that a Fetch from the database rarely requires a transaction. That is not to say there are not some cases where it is important. But the vast majority of cases can be supported without them. In a large database they can cause problems due to locking of rows and/or tables. There is little reason to add to the potential for deadlocks by adding transactions to SELECT statements.

Some of the biggest databases in the world (think Amazon) do not even use transactions at all due to the locking issues. They code their applications very differently because of this. But once you have the "CRUD framework" mapped out I imagine it is relavtively straightforward to support it.

Joe

 

Flatulus replied on Wednesday, January 09, 2008

Thanks Joe for the quick and concise reply!

Flatulus replied on Wednesday, January 09, 2008

<duplicate post>

Copyright (c) Marimer LLC