Package javax.jdo

Examples of javax.jdo.JDOUserException


                return this;
            }

            if (sm != null)
            {
                throw new JDOUserException(LOCALISER.msg("026003"));
            }
            if (!disconnecting)
            {
                throw new JDOUserException(LOCALISER.msg("026004"));
            }

            if (JPOXLogger.PERSISTENCE.isDebugEnabled())
            {
                JPOXLogger.PERSISTENCE.debug(LOCALISER.msg("026005", StringUtils.toJVMIDString(pc)));
View Full Code Here


                {
                    SCO sco = (SCO) newValue;
                    Object owner = sco.getOwner();
                    if (owner != null)
                    {
                        throw new JDOUserException(LOCALISER.msg("026007",
                            sco.getFieldName(), owner));
                    }
                }

                writeField(field, newValue);
View Full Code Here

    public LifeCycleState transitionReadField(StateManager sm, boolean isLoaded)
    {
        Transaction tx = sm.getObjectManager().getTransaction();
    if (!tx.isActive() && !tx.getNontransactionalRead())
    {
          throw new JDOUserException(LOCALISER.msg("027002"),sm.getInternalObjectId());
    }
        return this;
    }
View Full Code Here

                            pmfProps.putAll(pumd.getProperties());
                        }
                    }
                    else
                    {
                        throw new JDOUserException(LOCALISER_JDO.msg("012004", persistenceUnitName));
                    }

                    if (omfContext.getApi().equalsIgnoreCase("JPA"))
                    {
                        pumd.clearJarFiles(); // Dont use JARs when in J2SE for JPA
                    }
                }
                catch (JPOXException jpe)
                {
                    throw new JDOUserException(LOCALISER_JDO.msg("012005", persistenceUnitName));
                }
            }
        }

        // Append on any user properties
        if (props != null)
        {
            pmfProps.putAll(props);
        }

        // Apply the properties to the PMF
        try
        {
            setOptions(pmfProps);
        }
        catch (JPOXException jpe)
        {
            // Only throw JDOException and subclasses
            throw JPOXJDOHelper.getJDOExceptionForJPOXException(jpe);
        }

        if (pumd != null)
        {
            // Initialise the MetaDataManager with all files/classes for this persistence-unit
            // This is done now that all PMF properties are set (including the persistence-unit props)
            try
            {
                omfContext.getMetaDataManager().initialise(pumd, omfContext.getClassLoaderResolver(null));
            }
            catch (JPOXException jpe)
            {
                throw new JDOException(jpe.getMessage(),jpe);
            }
        }

        if (props != null)
        {
            // Process any lifecycle listeners defined in persistent properties
            Iterator propsIter = props.keySet().iterator();
            while (propsIter.hasNext())
            {
                String key = (String)propsIter.next();
                if (key.startsWith("javax.jdo.listener.InstanceLifecycleListener"))
                {
                    String listenerClsName = key.substring(45);
                    String listenerClasses = (String)props.get(key);
                    ClassLoaderResolver clr = omfContext.getClassLoaderResolver(null);
                    Class listenerCls = null;
                    try
                    {
                        listenerCls = clr.classForName(listenerClsName);
                    }
                    catch (ClassNotResolvedException cnre)
                    {
                        throw new JDOUserException(LOCALISER_JDO.msg("012022", listenerClsName));
                    }

                    InstanceLifecycleListener listener = null;

                    // Find method getInstance()
                    Method method = ClassUtils.getMethodForClass(listenerCls, "getInstance", null);
                    if (method != null)
                    {
                        // Create instance via getInstance()
                        try
                        {
                            listener = (InstanceLifecycleListener)method.invoke(null, null);
                        }
                        catch (Exception e)
                        {
                            throw new JDOUserException(LOCALISER_JDO.msg("012021", listenerClsName), e);
                        }
                    }
                    else
                    {
                        // Try default constructor
                        try
                        {
                            listener = (InstanceLifecycleListener)listenerCls.newInstance();
                        }
                        catch (Exception e)
                        {
                            throw new JDOUserException(LOCALISER_JDO.msg("012020", listenerClsName), e);
                        }
                    }

                    Class[] classes = null;
                    if (!StringUtils.isWhitespace(listenerClasses))
View Full Code Here

     * @param isLoaded if the field was previously loaded.
     * @return new LifeCycle state.
     **/
    public LifeCycleState transitionReadField(StateManager sm, boolean isLoaded)
    {
        throw new JDOUserException(LOCALISER.msg("027005"),sm.getInternalObjectId());
    }
View Full Code Here

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

        if (!disconnectClone(pc))
        {
            int fieldNumber = cmd.getAbsolutePositionOfMember(fieldName);
            if (fieldNumber == -1)
            {
                throw new JDOUserException(LOCALISER.msg("026002", fieldName, cmd.getFullClassName()));
            }
           
            makeDirty(fieldNumber);
        }
    }
View Full Code Here

                // replaced.
                ((JDOStateManagerImpl) sm).disconnect();
                return this;
            }

            throw new JDOUserException(LOCALISER.msg("026003"));
        }
        else if (pc == savedImage)
        {
            return null;
        }
View Full Code Here

                {
                    SCO sco = (SCO) newValue;
                    Object owner = sco.getOwner();
                    if (owner != null)
                    {
                        throw new JDOUserException(LOCALISER.msg("026007", sco.getFieldName(), owner));
                    }
                }

                replaceField(pc, field, newValue, true);
                postWriteField(wasDirty);
View Full Code Here

        if (!isOpen())
        {
            String msg = LOCALISER.msg("052600");
            if (api.equalsIgnoreCase("JDO"))
            {
                throw new JDOUserException(msg);
            }
            else
            {
                throw new NucleusUserException(msg);
            }
View Full Code Here

TOP

Related Classes of javax.jdo.JDOUserException

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.