intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Transaction & Security

Chia sẻ: An Nguyen | Ngày: | Loại File: PPT | Số trang:22

175
lượt xem
59
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Chuyên đề Lập trình Java & J2EE Chương 16 Biên soạn: Th.S Nguyễn văn Lành

Chủ đề:
Lưu

Nội dung Text: Transaction & Security

  1. Transaction & Security Chuyên đề Lập trình Java & J2EE Chương 16 Biên soạn: Th.S Nguyễn văn Lành    
  2. Motivation for Transactions  Atomic Operations  Recovery after Network or Machine Failure  Multiple Users Sharing Data  avoid those problems by properly using  transactions.    
  3. The ACID Properties  Atomicity guarantees that many operations are  bundled together and appear as one contiguous unit  of work.  Consistency guarantees that a transaction leaves  the system’s state to be consistent after a transaction  completes.  Isolation protects concurrently executing  transactions from seeing each other’s incomplete  results.  Durability guarantees that updates to managed  resources, such as database records, survive  failures.    
  4. Transactional Models  Flat transaction is a series of  operations that are performed  atomically as a single unit of work.  Nested transaction allows to embed  atomic units of work within other units of  work.    
  5. Transsaction demarcation  Programmatic Transactions  you are responsible for issuing a begin statement  and either a commit or an rollback statement   BMT: do not alow for Entity bean  Declarative Transactions  Specify transaction attributes in deployment  descriptor  Container automatically handle transactional  issues  CMT  Client­Initiated Transactions    
  6. Transaction attribute  Required  RequiresNew  Supports  Mandatory  Never  NotSupported    
  7.    
  8. Required    
  9. Requires New    
  10. Mandatory    
  11. Never    
  12. Bean Managed Transaction    
  13.    
  14. Java Transaction API (JTA)  JTA can be used in client & bean code  to programmatically control  transactional boundaries.  The interface you use to  programmatically control transactions is  javax.transaction.UserTransaction.    
  15. UserTransaction interface    
  16. Code sample    
  17. Transactional Isolation  Concurrency Control  locking on the database to prevent the two components from  reading data  Four transaction isolation levels:  READ UNCOMMITTED   does not offer any isolation guarantees (dirty read) but offers  the highest performance.  READ COMMITTED  REPEATABLE READ  SERIALIZABLE:   Use SERIALIZABLE for mission­critical systems that absolutely  must have perfect transactional isolation.  Pessimistic and Optimistic Concurrency Control    
  18. Distributed Transactions  Distributed flat transactions allow multiple  transaction participants, written by different  vendors, to collaborate under one  transactional context.  Two­Phase Commit Protocol  Phase One begins by sending a before commit  message to all resources involved in the  transaction.  Phase Two occurs only if Phase One completed  without an abort. At this time, all of the resource  managers, which can all be located and controlled  separately, perform the actual data updates    
  19. 2PC protocol    
  20. EJB Security  Authentication verifies that the client is  who he claims to be.  Authorization checks to see if an  already authenticated client is allowed  to perform a task.    
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2