Examples of usesVersionLocking()


Examples of oracle.toplink.essentials.descriptors.ClassDescriptor.usesVersionLocking()

        boolean changeTracked = false;
        try {
            ObjectBuilder builder = descriptor.getObjectBuilder();
           
            if (registeredObject != rmiClone && descriptor.usesVersionLocking() && ! mergedNewObjects.containsKey(registeredObject)) {
                VersionLockingPolicy policy = (VersionLockingPolicy) descriptor.getOptimisticLockingPolicy();
                if (policy.isStoredInObject()) {
                    Object currentValue = builder.extractValueFromObjectForField(registeredObject, policy.getWriteLockField(), session);
               
                    if (policy.isNewerVersion(currentValue, rmiClone, session.keyFromObject(rmiClone), session)) {
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        ClassDescriptor descriptor = getSession().getDescriptor(rmiClone);
        try {
            ObjectBuilder builder = descriptor.getObjectBuilder();
           
            if (registeredObject != rmiClone && descriptor.usesVersionLocking() && ! mergedNewObjects.containsKey(registeredObject)) {
                VersionLockingPolicy policy = (VersionLockingPolicy) descriptor.getOptimisticLockingPolicy();
                if (policy.isStoredInObject()) {
                    Object currentValue = builder.extractValueFromObjectForField(registeredObject, policy.getWriteLockField(), session);
               
                    if (policy.isNewerVersion(currentValue, rmiClone, session.keyFromObject(rmiClone), session)) {
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        }

        org.eclipse.persistence.queries.DoesExistQuery existQuery = descriptor.getQueryManager().getDoesExistQuery();
        // Optimize cache option to avoid executing the does exist query.
        if (existQuery.shouldCheckCacheForDoesExist()) {
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        // Check early return to check if it is a new object, i.e. null primary key.
        Boolean doesExist = (Boolean)existQuery.checkEarlyReturn(clone, primaryKey, unitOfWork, null);
        if (doesExist == Boolean.FALSE) {
            //bug272704: throw an exception if this object is new yet has a version set to avoid merging in deleted objects
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

   
        // Otherwise it is existing and not in the cache so it must be read.
        Object object = unitOfWork.readObject(clone);
        if (object == null) {
            //bug272704: throw an exception if this object is new yet has a version set to avoid merging in deleted objects
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

            return original;
        }
       
        // If version locking was used, check if the cache version is the correct version, otherwise invalidate,
        // Don't know for no locking, or field locking, so always merge.
        if ((!changeSet.isNew()) && descriptor.usesVersionLocking()) {
            if ((session.getCommandManager() != null) && (session.getCommandManager().getCommandConverter() != null)) {
                // Rebuild the version value from user format i.e the change set was converted to XML
                changeSet.rebuildWriteLockValueFromUserFormat(descriptor, session);
            }
            int difference = descriptor.getOptimisticLockingPolicy().getVersionDifference(changeSet.getInitialWriteLockValue(), original, changeSet.getId(), session);
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        ClassDescriptor descriptor = this.session.getDescriptor(rmiClone);
        try {
            ObjectBuilder builder = descriptor.getObjectBuilder();
           
            if (registeredObject != rmiClone && descriptor.usesVersionLocking() && ! mergedNewObjects.containsKey(registeredObject)) {
                VersionLockingPolicy policy = (VersionLockingPolicy) descriptor.getOptimisticLockingPolicy();
                if (policy.isStoredInObject()) {
                    Object currentValue = builder.extractValueFromObjectForField(registeredObject, policy.getWriteLockField(), session);
               
                    if (policy.isNewerVersion(currentValue, rmiClone, session.keyFromObject(rmiClone, descriptor), session)) {
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        ClassDescriptor descriptor = getSession().getDescriptor(rmiClone);
        try {
            ObjectBuilder builder = descriptor.getObjectBuilder();
           
            if (registeredObject != rmiClone && descriptor.usesVersionLocking() && ! mergedNewObjects.containsKey(registeredObject)) {
                VersionLockingPolicy policy = (VersionLockingPolicy) descriptor.getOptimisticLockingPolicy();
                if (policy.isStoredInObject()) {
                    Object currentValue = builder.extractValueFromObjectForField(registeredObject, policy.getWriteLockField(), session);
               
                    if (policy.isNewerVersion(currentValue, rmiClone, session.keyFromObject(rmiClone), session)) {
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        }

        org.eclipse.persistence.queries.DoesExistQuery existQuery = descriptor.getQueryManager().getDoesExistQuery();
        // Optimize cache option to avoid executing the does exist query.
        if (existQuery.shouldCheckCacheForDoesExist()) {
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
View Full Code Here

Examples of org.eclipse.persistence.descriptors.ClassDescriptor.usesVersionLocking()

        // Check early return to check if it is a new object, i.e. null primary key.
        Boolean doesExist = (Boolean)existQuery.checkEarlyReturn(clone, primaryKey, unitOfWork, null);
        if (doesExist == Boolean.FALSE) {
            //bug272704: throw an exception if this object is new yet has a version set to avoid merging in deleted objects
            if (descriptor.usesVersionLocking()){
                VersionLockingPolicy policy = (VersionLockingPolicy)descriptor.getOptimisticLockingPolicy();
                Object baseValue = policy.getBaseValue();
                Object objectLockValue = policy.getWriteLockValue(clone, primaryKey, unitOfWork);
                if ( policy.isNewerVersion(objectLockValue, baseValue) ) {
                    throw OptimisticLockException.objectChangedSinceLastMerge(clone);
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.