Search in sources :

Example 11 with PersistenceManager

use of com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager in project Payara by payara.

the class PersistenceManagerImpl method internalDeletePersistent.

private void internalDeletePersistent(PersistenceCapable pc) {
    if (!(pc.jdoIsPersistent())) {
        throw new JDOException(I18NHelper.getMessage(messages, // NOI18N
        "jdo.persistencemanagerimpl.internaldeletepersistent.transient"), new Object[] { pc });
    }
    StateManager sm = pc.jdoGetStateManager();
    PersistenceManager pm = (PersistenceManager) sm.getPersistenceManagerInternal();
    if (this != pm) {
        throw new JDOUserException(I18NHelper.getMessage(messages, // NOI18N
        "jdo.persistencemanagerimpl.another_pm"), new Object[] { pc });
    }
    if (!pc.jdoIsDeleted()) {
        // 
        // Synchronization is done in the state manager.
        // 
        sm.deletePersistent();
    }
}
Also used : PersistenceManager(com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager)

Aggregations

PersistenceManager (com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager)11 StateManager (com.sun.jdo.spi.persistence.support.sqlstore.StateManager)10 Iterator (java.util.Iterator)4 JDOUserException (com.sun.jdo.api.persistence.support.JDOUserException)2 ArrayList (java.util.ArrayList)1