DALmodule and sp transaction

17

description

DALmodule and sp transaction

Transcript of DALmodule and sp transaction

Page 1: DALmodule and sp transaction
Page 2: DALmodule and sp transaction

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd

Page 3: DALmodule and sp transaction

Week Target Achieved

1 30 27

2

3

Typing Speed

Page 4: DALmodule and sp transaction

Jobs Applied# Company Designation Applied Date Current Status

1

2

3

Page 5: DALmodule and sp transaction

Database Access Layer Module &

Database Transaction

[email protected]/usernametwitter.com/usernamein.linkedin.com/in/profilenamePhonenumber

Page 6: DALmodule and sp transaction

Data Access Layer

• A data access layer follows the idea of "separation of concerns“.

• DAL consist of the code used to pull data from a db.

• Its isolated from business logic layer and presentation layer.

Page 7: DALmodule and sp transaction

mamanages database

Page 8: DALmodule and sp transaction

Why???? DAL

• DAL allow us to change more easily the backend physical data storage technology without having large impact on business logic layer.

• Data access layers allow us to access data the same way for different application in our program.

Page 9: DALmodule and sp transaction

DB Transaction

• A transaction is a discrete unit of work that must be completely processed or not processed at all.

Page 10: DALmodule and sp transaction

Transaction states• Active, the initial state; the transaction stays

in this state until while it is still executing.

• A transition is terminated only if it has either been committed or aborted.

Page 11: DALmodule and sp transaction

Transaction States

• Partially committed, After the final statement has been executed

• At this point failure is still possible since changes may have been only done in main memory, a hardware failure could still occur.

Page 12: DALmodule and sp transaction

Transaction States

• Committed- after successful completion.• Once committed, the transaction can no

longer be undone by aborting it. • Its effect could be undone only by a

compensating transaction.

Page 13: DALmodule and sp transaction

Transaction States

• Failed, after the discovery that normal execution can no longer proceed.

• Once a transaction can not be completed, any changes that it made must be undone rolling it back.

Page 14: DALmodule and sp transaction

Transaction States

• Aborted, after the transaction has been rolled back the database has been restored to its state prior to the start of the transaction.

• The DBMS could either kill the transaction or restart the transaction.

Page 15: DALmodule and sp transaction

Create procedure DeleteDepartment ( @DepartmentID int ) AS BEGIN TRANSACTION DELETE FROM Employees WHERE DepartmentID = @DepartmentIDIF @@ERROR <> 0 BEGIN ROLLBACK RAISERROR ('Error in deleting employees in DeleteDepartment.', 16, 1) RETURN END DELETE FROM Departments WHERE DepartmentID = @DepartmentID IF @@ERROR <> 0 BEGIN ROLLBACK RAISERROR ('Error in deleting department in DeleteDepartment.', 16, 1) RETURN END COMMIT

Page 16: DALmodule and sp transaction

If this presentation helped you, please visit our page facebook.com/baabtra and like it.

Thanks in advance.

www.baabtra.com | www.massbaab.com |www.baabte.com

Page 17: DALmodule and sp transaction

Contact Us

Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

Start up VillageEranakulam,Kerala, India.

Email: [email protected]