Examples of ensureLock()


Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

            {
                ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                entry.cacheObject = copyStrategy.copy(userObject, _pb);
                // Assume that object exists, otherwise were the proxy came from?
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks
                entry.handler.addListener(this);
            }
            else
            {
                Object origCacheObj = _pb.getObjectByIdentity(oid);
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                {
                    entry.cacheObject = origCacheObj;
                }
                buildingObject = true;
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks

                if (userObject != null)
                {
                    if ((origCacheObj == null) && canCreate)
                    {
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

        }
        else
        {
            // The object in context is the same object attempted an insert on
            // Ensure we have the correct lock level
            lockManager.ensureLock(oid, _tx, lock, _pb);

            if (handler == null)
            {
                if (!swizzlingStrategy.isSameInstance(entry.userObject, userObject))
                {
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                            {
                                if (isModified(origFields[0], newFields[0]))
                                {
                                    entry.state = state.markDirty();
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentReferences(oid, entry.userObject,
                                            origFields[0], newFields[0], newFields[2]));
                                }
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                                if (isModified(origFields[1], newFields[1]))
                                {
                                    // there are modified collections,
                                    // so we need to lock the object and to swizzle it to cache
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentCollections(oid, entry.userObject,
                                            origFields[1], newFields[1], newFields[3]));
                                    changedCollections.add(oid);
                                }
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

            {
                ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                entry.cacheObject = copyStrategy.copy(userObject, _pb);
                // Assume that object exists, otherwise were the proxy came from?
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks
                entry.handler.addListener(this);
            }
            else
            {
                Object origCacheObj = _pb.getObjectByIdentity(oid);
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                {
                    entry.cacheObject = origCacheObj;
                }
                buildingObject = true;
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks

                if (userObject != null)
                {
                    if ((origCacheObj == null) && canCreate)
                    {
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

        }
        else
        {
            // The object in context is the same object attempted an insert on
            // Ensure we have the correct lock level
            lockManager.ensureLock(oid, _tx, lock, _pb);

            if (handler == null)
            {
                if (!swizzlingStrategy.isSameInstance(entry.userObject, userObject))
                {
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                            {
                                if (isModified(origFields[0], newFields[0]))
                                {
                                    entry.state = state.markDirty();
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentReferences(oid, entry.userObject,
                                            origFields[0], newFields[0], newFields[2]));
                                }
View Full Code Here

Examples of org.apache.ojb.otm.lock.LockManager.ensureLock()

                                if (isModified(origFields[1], newFields[1]))
                                {
                                    // there are modified collections,
                                    // so we need to lock the object and to swizzle it to cache
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentCollections(oid, entry.userObject,
                                            origFields[1], newFields[1], newFields[3]));
                                    changedCollections.add(oid);
                                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.