transactions

How To Maintain Transaction in N-Tier Architecture

余生颓废 提交于 2020-01-22 08:19:08
问题 I am developing application in N-Tier Architecture. as we all know that we need to implement transactions while insert/update/delete operation. please tell me how to use transaction in c#.net in N-Tier architecture. my architecture is like this Applicationform->middle_Layre->Factory->DataAccessLayre->StoredProcedure->Table in application form i create object of middleLayer and pass data in Insert/update/delete function of middle layer. i am creating object of sqlcommand in factoryclass and

How To Maintain Transaction in N-Tier Architecture

*爱你&永不变心* 提交于 2020-01-22 08:16:05
问题 I am developing application in N-Tier Architecture. as we all know that we need to implement transactions while insert/update/delete operation. please tell me how to use transaction in c#.net in N-Tier architecture. my architecture is like this Applicationform->middle_Layre->Factory->DataAccessLayre->StoredProcedure->Table in application form i create object of middleLayer and pass data in Insert/update/delete function of middle layer. i am creating object of sqlcommand in factoryclass and

How To Maintain Transaction in N-Tier Architecture

陌路散爱 提交于 2020-01-22 08:15:10
问题 I am developing application in N-Tier Architecture. as we all know that we need to implement transactions while insert/update/delete operation. please tell me how to use transaction in c#.net in N-Tier architecture. my architecture is like this Applicationform->middle_Layre->Factory->DataAccessLayre->StoredProcedure->Table in application form i create object of middleLayer and pass data in Insert/update/delete function of middle layer. i am creating object of sqlcommand in factoryclass and

Difference Between Transaction and TransactionScope

我的梦境 提交于 2020-01-22 07:16:08
问题 I am developing an application which communicates with an SQL Server 2005 database to execute some stored procedures. My client demands that all transactions be managed on the C# side and not by SQL Server, and so I am using System.Transactions.TransactionScope when accessing the database. However, I have just seen the System.Transactions.Transaction datatype, and I am confused... What are the main pros/cons of each type? Which one should I use? Please note that I must also use Enterprise

Difference Between Transaction and TransactionScope

有些话、适合烂在心里 提交于 2020-01-22 07:15:26
问题 I am developing an application which communicates with an SQL Server 2005 database to execute some stored procedures. My client demands that all transactions be managed on the C# side and not by SQL Server, and so I am using System.Transactions.TransactionScope when accessing the database. However, I have just seen the System.Transactions.Transaction datatype, and I am confused... What are the main pros/cons of each type? Which one should I use? Please note that I must also use Enterprise

What's the point to enclose select statements in a transaction?

≯℡__Kan透↙ 提交于 2020-01-22 05:49:05
问题 What's the point to enclose select statements in a transaction? I think select statements are just "GET" data from the database, they don't have chance to rollback something, because you just can't change the data. So, does that to say we never need put select statements in a transaction? Am I right? Thanks. 回答1: You're right: at the standard isolation level, read committed , you do not need to wrap select statements in transactions. Select statements will be protected from dirty reads

Rails 3. Nested transactions. Exception in a child block

ぐ巨炮叔叔 提交于 2020-01-21 12:46:50
问题 Why doesn't ActiveRecord rollback changes in nested transactions after exception was risen in a child block? Here are examples: 1. >> Client.transaction do ?> Client.create(:name => 'Pavel') >> Client.transaction do ?> Client.create(:name => 'Elena') >> raise ActiveRecord::Rollback >> end >> end => nil >> Client.all.map(&:name) => ["Pavel", "Elena"] # instead of [] 2. >> Client.transaction do ?> Client.create(:name => 'Pavel') >> Client.transaction(:requires_new => true) do ?> Client.create(

Rails 3. Nested transactions. Exception in a child block

蹲街弑〆低调 提交于 2020-01-21 12:46:17
问题 Why doesn't ActiveRecord rollback changes in nested transactions after exception was risen in a child block? Here are examples: 1. >> Client.transaction do ?> Client.create(:name => 'Pavel') >> Client.transaction do ?> Client.create(:name => 'Elena') >> raise ActiveRecord::Rollback >> end >> end => nil >> Client.all.map(&:name) => ["Pavel", "Elena"] # instead of [] 2. >> Client.transaction do ?> Client.create(:name => 'Pavel') >> Client.transaction(:requires_new => true) do ?> Client.create(

inno db isolation levels and locking

佐手、 提交于 2020-01-21 03:11:18
问题 I am reading a manual about innodb transactions but still, there is lots of unclear stuff to me. For instance, I don't quite understand to the following behaviour: -- client 1 -- client 2 mysql> create table simple (col int) engine=innodb; mysql> insert into simple values(1); Query OK, 1 row affected (0.00 sec) mysql> insert into simple values(2); Query OK, 1 row affected (0.00 sec) mysql> select @@tx_isolation; +-----------------+ | @@tx_isolation | +-----------------+ | REPEATABLE-READ | +-

inno db isolation levels and locking

心不动则不痛 提交于 2020-01-21 03:11:00
问题 I am reading a manual about innodb transactions but still, there is lots of unclear stuff to me. For instance, I don't quite understand to the following behaviour: -- client 1 -- client 2 mysql> create table simple (col int) engine=innodb; mysql> insert into simple values(1); Query OK, 1 row affected (0.00 sec) mysql> insert into simple values(2); Query OK, 1 row affected (0.00 sec) mysql> select @@tx_isolation; +-----------------+ | @@tx_isolation | +-----------------+ | REPEATABLE-READ | +-