Atomicity Problem:
Consider the following scenario where in master and child tables are updated during insert transaction:
Master Table: Employee
(step 1) First Insert in Master table:
Employee objEmployee=new Employee();
objEmployee.Name=...
objEmployee.DOB=...
DataRepository.EmployeeProvider.Insert(objEmployee);
Child Table: EmpEmail
(Step 2) First Insert in child table:
EmpEmail objEmpEmail=new EmpEmail();
objEmpEmail.Email=...
objEmpEmail.EmployeeCode=objEmployee,Code;
DataRepository.EmpEmailProvider.Insert(objEmpEmail);
(Step 3) First Insert in child table:
Hello,
What set of templates are you using? In our CSLA templates we pass the parent to the child along with the connection object which already has a transaction.
Thanks
-Blake Niemyjski
Blake Niemyjski CodeSmith Tools, LLC. Software Development Engineer Blog: http://windowscoding.com/blogs/blake/ .NetTiers team | Visit http://www.nettiers.net
Can you please provide the sample code for the same?
A sample of this can be found here. Please download a sample from the link and then look in the .DataAccess partial classes of an entity like Supplier or Products in the Business Project.