Package com.sun.jdo.spi.persistence.support.sqlstore

Examples of com.sun.jdo.spi.persistence.support.sqlstore.StateManager


                    I18NHelper.getMessage(
                            messages,
                            "jdo.versionconsistencycacheimpl.get.entering", // NOI18N
                            new Object[] {pcType, oid}));
        }
        StateManager rc = null;

        VCCache oid2sm = null;
        synchronized (pcTypeMap) {
            oid2sm = (VCCache) pcTypeMap.get(pcType);
        }
View Full Code Here


                            messages,
                            "jdo.versionconsistencycacheimpl.remove.entering", // NOI18N
                            new Object[] {pcType, oid}));
        }

        StateManager rc = null;
        synchronized (pcTypeMap) {
            VCCache oid2sm = (VCCache) pcTypeMap.get(pcType);

            if (null != oid2sm) {
                rc = (StateManager) oid2sm.remove(oid);
View Full Code Here

        boolean modified = false;

        if (owner != null)
        {
            StateManager stateManager = owner.jdoGetStateManager();

            if (stateManager != null)
            {
                PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                pm.acquireShareLock();

                try
                {
                    pm.acquireFieldUpdateLock();
                    try
                    {
                        // Mark the field as dirty
                        stateManager.makeDirty(fieldName);

                        for (Iterator iter = c.iterator(); iter.hasNext();)
                        {
                            Object o = iter.next();
                            if (!super.contains(o))
                            {
                                if (removed.remove(o) == false)
                                {
                                    added.add(o);
                                }

                                super.add(o);
                                modified = true;
                            }
                        }

                        // Apply updates
                        if (modified)
                        {
                            stateManager.applyUpdates(fieldName, this);
                        }
                        return modified;
                    }
                    finally
                    {
View Full Code Here

    {
    // Mark the field as dirty

        if (owner != null)
        {
            StateManager stateManager = owner.jdoGetStateManager();

            if (stateManager != null)
            {
                PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                pm.acquireShareLock();

                try
                {
                    pm.acquireFieldUpdateLock();
                    try
                    {
                        stateManager.makeDirty(fieldName);

                        boolean modified = super.remove(o);

                        if (modified)
                        {
                            if (added.remove(o) == false)
                            {
                                removed.add(o);
                            }

                            stateManager.applyUpdates(fieldName, this);
                        }

                        return modified;
                    }
                    finally
View Full Code Here

    {
        // Mark the field as dirty

        if (owner != null)
        {
            StateManager stateManager = owner.jdoGetStateManager();

            if (stateManager != null)
            {
                PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                pm.acquireShareLock();

                try
                {
                    pm.acquireFieldUpdateLock();
                    try
                    {
                        stateManager.makeDirty(fieldName);

                        for (Iterator iter = c.iterator(); iter.hasNext();)
                        {
                            Object o = iter.next();
                            if (super.contains(o))
                            {
                                if (added.remove(o) == false)
                                {
                                    removed.add(o);
                                }
                            }
                        }

                        boolean modified = super.removeAll(c);

                        // Apply updates
                        if (modified)
                        {
                            stateManager.applyUpdates(fieldName, this);
                        }

                        return modified;
                    }
                    finally
View Full Code Here

     */
    public boolean retainAll(Collection c)
    {
        if (owner != null)
        {
            StateManager stateManager = owner.jdoGetStateManager();

            if (stateManager != null)
            {
                PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                pm.acquireShareLock();

                try
                {
                    pm.acquireFieldUpdateLock();
                    try
                    {
                        // Mark the field as dirty
                        stateManager.makeDirty(fieldName);

                        for (Iterator iter = super.iterator(); iter.hasNext();)
                        {
                            Object o = iter.next();
                            if (!c.contains(o))
                            {
                                if (added.remove(o) == false)
                                {
                                    removed.add(o);
                                }
                            }
                        }

                        boolean modified = super.retainAll(c);

                        // Apply updates

                        if (modified)
                        {
                            stateManager.applyUpdates(fieldName, this);
                        }

                        return modified;
                    }
                    finally
View Full Code Here

     */
    public void clear()
    {
        if (owner != null)
        {
            StateManager stateManager = owner.jdoGetStateManager();

            if (stateManager != null)
            {
                PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                pm.acquireShareLock();

                try
                {
                    pm.acquireFieldUpdateLock();
                    try
                    {
                        // Mark the field as dirty
                        stateManager.makeDirty(fieldName);

                        removed.clear();
                        added.clear();

                        for (Iterator iter = super.iterator(); iter.hasNext();)
                        {
                            removed.add(iter.next());
                        }

                        super.clear();

                        // Apply updates
                        stateManager.applyUpdates(fieldName, this);
                        return;
                    }
                    finally
                    {
                        pm.releaseFieldUpdateLock();
View Full Code Here

    /**
     * Marks object dirty
     */
    public StateManager makeDirty()
    {
        StateManager stateManager = owner.jdoGetStateManager();

        if (stateManager != null)
        {
            stateManager.makeDirty(fieldName);
        }

        return stateManager;
    }
View Full Code Here

            if (lastReturned == null)
                throw new IllegalStateException();

            if (_caller.owner != null) {
                // Mark the field as dirty
                StateManager stateManager = _caller.owner.jdoGetStateManager();

                if (stateManager != null) {
                    PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

                    pm.acquireShareLock();

                    try {
                        pm.acquireFieldUpdateLock();
                        try
                        {
                            stateManager.makeDirty(_caller.fieldName);

                            _iterator.remove();

                            if (added.remove(lastReturned) == false) {
                                removed.add(lastReturned);
                            }

                            stateManager.applyUpdates(_caller.fieldName, _caller);

                        } finally {
                            pm.releaseFieldUpdateLock();
                        }
                    }
View Full Code Here

     */
    public StateManager makeDirty()
    {
    if (owner != null)
    {
      StateManager stateManager = owner.jdoGetStateManager();
     
      if (stateManager != null)
      {
        PersistenceManager pm = (PersistenceManager) stateManager.getPersistenceManagerInternal();

        pm.acquireShareLock();
       
        try
        {
          synchronized (stateManager)
          { 
            //
            // Need to recheck owner because it could be set to
            // null before we lock the stateManager.
            //
            if (owner != null)
            {
              stateManager.makeDirty(fieldName);
              return stateManager;
            }
          }
        }
        finally
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.StateManager

Copyright © 2018 www.massapicom. 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.