mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/persistence/AbstractDataStore.java
@Override
    public long removeOnJdoQuery(final Query query)
    {
        long numberDeleted;//NOCHECKSTYLE gets assigned in try/catch
        synchronized (this)
        {
            final PersistenceManager persistenceManager = getPersistenceManager();
            final Transaction transaction = persistenceManager.currentTransaction();
            try
            {
                m_WakeLock.activate();

                transaction.begin();
                numberDeleted = query.deletePersistentAll();
                transaction.commit();

                transaction.begin();
                deleteCleanup();
                transaction.commit();
            }
            finally
            {
                if (transaction.isActive())
                {
                    transaction.rollback();
                }

                m_WakeLock.cancel();
            }
        }

        return numberDeleted;
    }
/**
     * Helper method to remove based on a JDO query.
     * @param query
     *          the query used to remove
     * @return the number of items deleted
     */
Helper method to remove based on a JDO query.
@param query
the query used to remove
@return the number of items deleted
Helper method to remove based on a JDO query . @param query the query used to remove @return the number of items deleted
@Override
    public long removeOnJdoQuery(final Query query)
    {
        long numberDeleted;
        synchronized (this)
        {
            final PersistenceManager persistenceManager = getPersistenceManager();
            final Transaction transaction = persistenceManager.currentTransaction();
            try
            {
                m_WakeLock.activate();
                transaction.begin();
                numberDeleted = query.deletePersistentAll();
                transaction.commit();
                transaction.begin();
                deleteCleanup();
                transaction.commit();
            }
            finally
            {
                if (transaction.isActive())
                {
                    transaction.rollback();
                }
                m_WakeLock.cancel();
            }
        }
        return numberDeleted;
    }
@ Override public long removeOnJdoQuery ( final Query query ) { long numberDeleted ; synchronized ( this ) { final PersistenceManager persistenceManager = getPersistenceManager ( ) ; final Transaction transaction = persistenceManager . currentTransaction ( ) ; try { m_WakeLock . activate ( ) ; transaction . begin ( ) ; numberDeleted = query . deletePersistentAll ( ) ; transaction . commit ( ) ; transaction . begin ( ) ; deleteCleanup ( ) ; transaction . commit ( ) ; } finally { if ( transaction . isActive ( ) ) { transaction . rollback ( ) ; } m_WakeLock . cancel ( ) ; } } return numberDeleted ; }
Helper method to remove based on a JDO query.
Helper method to remove based on a JDO query .
//NOCHECKSTYLE gets assigned in try/catch