This method is similar to {@link #fetch} except that it willload the object only once within a transaction and always return the same instance.
If the object is loaded for read-only then no lock is acquired and updates to the object are not reflected at commit time. If the object is loaded for read-write then a read lock is acquired (unless timeout or deadlock detected) and the object is stored at commit time. The object is then considered persistent and may be deleted or upgraded to write lock. If the object is loaded for exclusive access then a write lock is acquired and the object is synchronized with the persistent copy.
Attempting to load the object twice in the same transaction, once with exclusive lock and once with read-write lock will result in an exception. @param engine The persistence engine @param molder The class persistence molder @param identity The object's identity @param objectToBeLoaded The object to fetch (single instance per transaction) @param suggestedAccessMode The access mode (see {@link AccessMode}) the values in persistent storage @throws LockNotGrantedException Timeout or deadlock occuredattempting to acquire lock on object @throws ObjectNotFoundException The object was not found inpersistent storage @throws PersistenceException An error reported by thepersistence engine @return object being loaded
|
|
|
|