Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
docu...
Week Target Achieved
1 30 27
2
3
Typing Speed
Jobs Applied
# Company Designation Applied Date Current Status
1
2
3
Database Access Layer
Module &
Database Transaction
Name
@gmail.com
www.facebook.com/userna
me
twitter.com/username
in.lin...
Data Access Layer
• A data access layer follows the idea of
"separation of concerns“.
• DAL consist of the code used to pu...
mamanages database
Why???? DAL
• DAL allow us to change more easily the
backend physical data storage technology
without having large impact ...
DB Transaction
• A transaction is a discrete unit of work that
must be completely processed or not
processed at all.
Transaction states
• Active, the initial state; the transaction stays
in this state until while it is still executing.
• A...
Transaction States
• Partially committed, After the final statement
has been executed
• At this point failure is still pos...
Transaction States
• Committed- after successful completion.
• Once committed, the transaction can no
longer be undone by ...
Transaction States
• Failed, after the discovery that normal
execution can no longer proceed.
• Once a transaction can not...
Transaction States
• Aborted, after the transaction has been rolled back the
database has been restored to its state prior...
Create procedure DeleteDepartment ( @DepartmentID int ) AS
BEGIN TRANSACTION
DELETE FROM Employees WHERE DepartmentID = @D...
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.co...
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, N...
Database Abstraction Layer and Transaction in Stored procedures
Upcoming SlideShare
Loading in …5
×

Database Abstraction Layer and Transaction in Stored procedures

376 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
376
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Database Abstraction Layer and Transaction in Stored procedures

  1. 1. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  2. 2. Week Target Achieved 1 30 27 2 3 Typing Speed
  3. 3. Jobs Applied # Company Designation Applied Date Current Status 1 2 3
  4. 4. Database Access Layer Module & Database Transaction Name @gmail.com www.facebook.com/userna me twitter.com/username in.linkedin.com/in/profilena me Phonenumber
  5. 5. 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.
  6. 6. mamanages database
  7. 7. 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.
  8. 8. DB Transaction • A transaction is a discrete unit of work that must be completely processed or not processed at all.
  9. 9. 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.
  10. 10. 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.
  11. 11. 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.
  12. 12. 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.
  13. 13. 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.
  14. 14. Create procedure DeleteDepartment ( @DepartmentID int ) AS BEGIN TRANSACTION DELETE FROM Employees WHERE DepartmentID = @DepartmentID IF @@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
  15. 15. 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
  16. 16. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com

×