Summary
In this chapter, you learned about the problem known as “lost updates.” You looke various techniques you can use to solve this problem. Changing the transaction isolation level to SERIALIZABLE can solve the problem in some special cases. The technique of locking the row beforehand (pessimistic locking) solves the problem for cases where you maintain state across pages. Optimistic locking solves the problem by detecting the changes made by another transaction and asking the user to retry his transaction if unsuccessful. In most of the web applications that use connection pooling, optimistic locking is the only real alternative since it does not require the application to maintain connections across pages. You examined several implementations of optimistic locking, and finally briefly compared optimistic and pessimistic locking.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2005 R. M. Menon
About this chapter
Cite this chapter
(2005). Locking-Related Issues. In: Expert Oracle JDBC Programming. Apress. https://doi.org/10.1007/978-1-4302-0029-1_16
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0029-1_16
Publisher Name: Apress
Print ISBN: 978-1-59059-407-0
Online ISBN: 978-1-4302-0029-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books