Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we implement Transaction on C# objects?

Tags:

c#

.net

Can we use transaction on C# objects.

Does all the Transactions are only for Relational Database like MSSQL, ORACLE, etc...??

Thanks.

like image 768
Nirajan Singh Avatar asked Feb 25 '10 09:02

Nirajan Singh


1 Answers

What you are asking is called Software Transactional Memory. Since this is currently an open area of research and there is no native C# language support at the moment, you might be better off using the existing synchronization options for C#, such as the lock keyword, monitors, wait handles, etc.

If you really need advanced transactional features, there are a lot of library implementations, see this list in Wikipedia for some examples:

  • https://en.wikipedia.org/wiki/Software_transactional_memory#C.23
like image 166
Heinzi Avatar answered Sep 27 '22 16:09

Heinzi