It is not possible to upgrade to a locked lock in the middle of a transaction. Objects loaded in this mode are always synchronized with the database, that is, they will never be obtained from the cache and always re-loaded for each new transaction. When the same object is queried twice in a transaction as read-only, Castor will return two separate objects, allowing the caller to modify one object without altering the other. Castor will utilize the cache and only perform one load from the database to the cache. If the object will not be modified, or modifications will be stored in the database, it is recommended to use the shared mode.
Shared mode allows the same object to be returned twice in the same transaction.
Visibility of Changes Whether not changes occuring in one transaction are visible to other transactions, depends on the transaction isolation level specified for the database connection. Whether or not changes are visible in the current transaction depends on the operation being done. There are four types of changes, the following table summarizes the affect of each change in one transaction on other queries in that transaction as well as other transactions. All rights reserved. Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries.