Package org.jpox.exceptions

Examples of org.jpox.exceptions.JPOXUserException


     * @param sm StateManager.
     * @return new LifeCycle state.
     **/
    public LifeCycleState transitionMakeNontransactional(StateManager sm)
    {
        throw new JPOXUserException(LOCALISER.msg("027013"),sm.getInternalObjectId());
    }
View Full Code Here


    {
        if (detachAllOnCommit)
        {
            return changeState(sm, TRANSIENT);
        }
        throw new JPOXUserException(LOCALISER.msg("027014"),sm.getInternalObjectId());
    }
View Full Code Here

            loadFromStore();
        }
        else
        {
            // TODO Provide a datastore method to do this
            throw new JPOXUserException("JPOX doesn't currently support SortedMap.headMap() when not using cached containers");
        }

        return delegate.headMap(toKey);
    }
View Full Code Here

            loadFromStore();
        }
        else
        {
            // TODO Provide a datastore method to do this
            throw new JPOXUserException("JPOX doesn't currently support SortedMap.subMap() when not using cached container");
        }

        return delegate.subMap(fromKey, toKey);
    }
View Full Code Here

     */
    public synchronized void close()
    {
        if (closed)
        {
            throw new JPOXUserException(LOCALISER.msg("010002"));
        }
        if (tx.isActive())
        {
            throw new TransactionActiveOnCloseException(this);
        }
View Full Code Here

            // automatically on garbage collection, if the object can be evicted. it means not all
            // jdo states allows the object to be evicted.
            StateManager sm = findStateManager(obj);
            if (sm == null)
            {
                throw new JPOXUserException(LOCALISER.msg("010007", getApiAdapter().getIdForObject(obj)));
            }
            sm.evict();
        }
        finally
        {
View Full Code Here

            assertNotDetached(obj);

            StateManager sm = findStateManager(obj);
            if (sm == null)
            {
                throw new JPOXUserException(LOCALISER.msg("010007", getApiAdapter().getIdForObject(obj)));
            }

            if (getApiAdapter().isPersistent(obj) && sm.isWaitingToBeFlushedToDatastore())
            {
                // Persistent but not yet flushed so nothing to "refresh" from!
View Full Code Here

                failures.add(e);
            }
        }
        if (failures != null && !failures.isEmpty())
        {
            throw new JPOXUserException(LOCALISER.msg("010037"), (Exception[]) failures.toArray(new Exception[failures.size()]));
        }
    }
View Full Code Here

            assertNotDetached(obj);

            StateManager sm = findStateManager(obj);
            if (sm == null)
            {
                throw new JPOXUserException(LOCALISER.msg("010007", getApiAdapter().getIdForObject(obj)));
            }
            sm.retrieve(fgOnly);
        }
        finally
        {
View Full Code Here

            }
            ObjectManager om = ObjectManagerHelper.getObjectManager(obj);
            if (om != null && om != this)
            {
                // Object managed by a different manager
                throw new JPOXUserException(LOCALISER.msg("010007", obj));
            }

            Object persistedPc = obj; // Persisted object is the passed in pc (unless being attached as a copy)
            if (getApiAdapter().isDetached(obj))
            {
                // Detached : attach it
                assertDetachable(obj);
                if (copyOnAttach)
                {
                    // Attach a copy and return the copy
                    persistedPc = attachObjectCopy(obj, getApiAdapter().getIdForObject(obj) == null);
                }
                else
                {
                    // Attach the object
                    attachObject(obj, getApiAdapter().getIdForObject(obj) == null);
                    persistedPc = obj;
                }
            }
            else if (getApiAdapter().isTransactional(obj) && !getApiAdapter().isPersistent(obj))
            {
                // TransientTransactional : persist it
                StateManager sm = findStateManager(obj);
                if (sm == null)
                {
                    throw new JPOXUserException(LOCALISER.msg("010007", getApiAdapter().getIdForObject(obj)));
                }
                sm.makePersistentTransactionalTransient();
            }
            else if (!getApiAdapter().isPersistent(obj))
            {
View Full Code Here

TOP

Related Classes of org.jpox.exceptions.JPOXUserException

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.