Package org.datanucleus.store.fieldmanager

Examples of org.datanucleus.store.fieldmanager.PersistFieldManager


        if (dirty && !myLC.isDeleted() && myLC.isTransactional() && myOM.isDelayDatastoreOperationsEnabled())
        {
            // Already provisionally persistent, but delaying til commit so just re-run reachability
            // to bring in any new objects that are now reachable
            provideFields(cmd.getAllMemberPositions(), new PersistFieldManager(this, false));
            return;
        }

        getCallbackHandler().prePersist(myPC);

        if (isFlushedNew())
        {
            // With CompoundIdentity bidir relations when the SM is created for this object ("initialiseForPersistentNew") the persist
            // of the PK PC fields can cause the flush of this object, and so it is already persisted by the time we ge here
            registerTransactional();
            return;
        }

        if (cmd.isEmbeddedOnly())
        {
            // Cant persist an object of this type since can only be embedded
            return;
        }

        // If this is an embedded/serialised object becoming persistent in its own right, assign an identity.
        if (myID == null)
        {
            setIdentity(false);
        }

        dirty = true;

        if (myOM.isDelayDatastoreOperationsEnabled())
        {
            // Delaying datastore flush til later
            myOM.markDirty(this, false);
            if (NucleusLogger.PERSISTENCE.isDebugEnabled())
            {
                NucleusLogger.PERSISTENCE.debug(LOCALISER.msg("026028", StringUtils.toJVMIDString(myPC)));
            }
            registerTransactional();

            if (myLC.isTransactional() && myLC.isDeleted())
            {
                // Re-persist of a previously deleted object
                myLC = myLC.transitionMakePersistent(this);
            }

            // TODO Only run this if we have relations from this class
            // Run reachability on all fields of this PC - JDO2 [12.6.7]
            provideFields(cmd.getAllMemberPositions(), new PersistFieldManager(this, false));
        }
        else
        {
            // Persist the object and all reachables
            internalMakePersistent();
View Full Code Here


                // TODO versioned object so set its version
            }

            // Perform any reachability
            int[] fieldNumbers = sm.getClassMetaData().getAllMemberPositions();
            sm.provideFields(fieldNumbers, new PersistFieldManager(sm, true));

            if (NucleusLogger.DATASTORE_PERSIST.isDebugEnabled())
            {
                NucleusLogger.DATASTORE_PERSIST.info(LOCALISER.msg("XML.Insert.ObjectPersisted",
                    sm.toPrintableID(), sm.getInternalObjectId()));
View Full Code Here

            node.getParentNode().removeChild(node);
            JAXBRuntimeBinder.marshall(sm.getObject(), classnode, this.storeMgr.getMetaDataManager(),
                sm.getExecutionContext().getClassLoaderResolver());

            // Handle reachability so any reachable objects in the updated fields are also persisted
            sm.provideFields(fieldNumbers, new PersistFieldManager(sm, false));

            if (NucleusLogger.DATASTORE_PERSIST.isDebugEnabled())
            {
                NucleusLogger.DATASTORE_PERSIST.debug(LOCALISER.msg("XML.ExecutionTime",
                    (System.currentTimeMillis() - startTime)));
View Full Code Here

        if (dirty && !myLC.isDeleted && myLC.isTransactional && myOM.isDelayDatastoreOperationsEnabled())
        {
            // Already provisionally persistent, but delaying til commit so just re-run reachability
            // to bring in any new objects that are now reachable
            provideFields(cmd.getAllMemberPositions(), new PersistFieldManager(this, false));
            return;
        }

        getCallbackHandler().prePersist(myPC);

        if (flushedNew)
        {
            // With CompoundIdentity bidir relations when the SM is created for this object ("initialiseForPersistentNew") the persist
            // of the PK PC fields can cause the flush of this object, and so it is already persisted by the time we ge here
            registerTransactional();
            return;
        }

        if (cmd.isEmbeddedOnly())
        {
            // Cant persist an object of this type since can only be embedded
            return;
        }

        // If this is an embedded/serialised object becoming persistent in its own right, assign an identity.
        if (myID == null)
        {
            setIdentity(false);
        }

        dirty = true;

        if (myOM.isDelayDatastoreOperationsEnabled())
        {
            // Delaying datastore flush til later
            myOM.markDirty(this, false);
            if (NucleusLogger.PERSISTENCE.isDebugEnabled())
            {
                NucleusLogger.PERSISTENCE.debug(LOCALISER.msg("026028", StringUtils.toJVMIDString(myPC)));
            }
            registerTransactional();

            if (myLC.isTransactional && myLC.isDeleted())
            {
                // Re-persist of a previously deleted object
                myLC = myLC.transitionMakePersistent(this);
            }

            // Run reachability on all fields of this PC - JDO2 [12.6.7]
            provideFields(cmd.getAllMemberPositions(), new PersistFieldManager(this, false));
        }
        else
        {
            // Persist the object and all reachables
            internalMakePersistent();
View Full Code Here

TOP

Related Classes of org.datanucleus.store.fieldmanager.PersistFieldManager

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.