mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/persistence/AbstractDataStore.java
protected DataType makePersistent(final DataType object)
            throws PersistenceFailedException
    {
        if (getUsableSpace() < getMinUsableSpace())
        {
            throw new PersistenceFailedException(String.format("Not enough usable space, require %d, only %d", 
                    getMinUsableSpace(), getUsableSpace()));
        }
        
        synchronized (this)
        {
            final PersistenceManager persistenceManager = getPersistenceManager();
            final Transaction transaction = persistenceManager.currentTransaction();
            final DataType persistedObject;
            try
            {
                m_WakeLock.activate();

                transaction.begin();
                persistedObject = persistenceManager.makePersistent(object);
                transaction.commit();
            }
            catch (final JDOException exception)
            {
                throw new PersistenceFailedException("Persist failed.", exception);
            }
            finally
            {
                if (transaction.isActive())
                {
                    transaction.rollback();
                }
                
                m_WakeLock.cancel();
            }

            return persistedObject;
        }
    }
/**
     * Persist the class object T to the data store.
     * 
     * @param object
     *            the class T object to be persisted
     * @return the persistence managed object reference
     * @throws PersistenceFailedException
     *          if the call to make persistent fails or there is not enough usable space
     */
Persist the class object T to the data store.

@param object
the class T object to be persisted
@return the persistence managed object reference
@throws PersistenceFailedException
if the call to make persistent fails or there is not enough usable space
Persist the class object T to the data store . @param object the class T object to be persisted @return the persistence managed object reference @throws PersistenceFailedException if the call to make persistent fails or there is not enough usable space
protected DataType makePersistent(final DataType object)
            throws PersistenceFailedException
    {
        if (getUsableSpace() < getMinUsableSpace())
        {
            throw new PersistenceFailedException(String.format("Not enough usable space, require %d, only %d", 
                    getMinUsableSpace(), getUsableSpace()));
        }
        synchronized (this)
        {
            final PersistenceManager persistenceManager = getPersistenceManager();
            final Transaction transaction = persistenceManager.currentTransaction();
            final DataType persistedObject;
            try
            {
                m_WakeLock.activate();
                transaction.begin();
                persistedObject = persistenceManager.makePersistent(object);
                transaction.commit();
            }
            catch (final JDOException exception)
            {
                throw new PersistenceFailedException("Persist failed.", exception);
            }
            finally
            {
                if (transaction.isActive())
                {
                    transaction.rollback();
                }
                m_WakeLock.cancel();
            }
            return persistedObject;
        }
    }
protected DataType makePersistent ( final DataType object ) throws PersistenceFailedException { if ( getUsableSpace ( ) < getMinUsableSpace ( ) ) { throw new PersistenceFailedException ( String . format ( "Not enough usable space, require %d, only %d" , getMinUsableSpace ( ) , getUsableSpace ( ) ) ) ; } synchronized ( this ) { final PersistenceManager persistenceManager = getPersistenceManager ( ) ; final Transaction transaction = persistenceManager . currentTransaction ( ) ; final DataType persistedObject ; try { m_WakeLock . activate ( ) ; transaction . begin ( ) ; persistedObject = persistenceManager . makePersistent ( object ) ; transaction . commit ( ) ; } catch ( final JDOException exception ) { throw new PersistenceFailedException ( "Persist failed." , exception ) ; } finally { if ( transaction . isActive ( ) ) { transaction . rollback ( ) ; } m_WakeLock . cancel ( ) ; } return persistedObject ; } }
Persist the class object T to the data store.
Persist the class object T to the data store .