Package com.impetus.kundera.proxy

Examples of com.impetus.kundera.proxy.LazyInitializationException


    }

    @Test
    public void testLazyInitializationException()
    {
        LazyInitializationException exception = new LazyInitializationException("Error with string");
        Assert.assertNotNull(exception);
        exception = new LazyInitializationException(new RuntimeException());
        Assert.assertNotNull(exception);
    }
View Full Code Here


            EntityMetadata m = KunderaMetadataManager.getEntityMetadata(getPersistenceDelegator().getKunderaMetadata(),
                    getOwner().getClass());

            if (!getPersistenceDelegator().isOpen())
            {
                throw new LazyInitializationException(
                        "Unable to load Proxy Collection."
                                + " This happens when you access a lazily loaded proxy collection in an entity after entity manager has been closed.");
            }

            getPersistenceDelegator().getClient(m).getReader()
View Full Code Here

            Enhancer.registerCallbacks(factory, new Callback[] { instance, null });
            proxy = (KunderaProxy) factory.newInstance();
        }
        catch (IllegalAccessException e)
        {
            throw new LazyInitializationException(e);
        }
        catch (InstantiationException e)
        {
            throw new LazyInitializationException(e);
        }
        finally
        {
            Enhancer.registerCallbacks(factory, null);
        }
View Full Code Here

                }
                return ((returnValue == target) ? proxy : returnValue);
            }
            catch (InvocationTargetException ite)
            {
                throw new LazyInitializationException(ite);
            }
        }
        else
        {
            // while constructor is running
            throw new LazyInitializationException("unexpected case hit, method=" + method.getName());
        }

    }
View Full Code Here

    {
        if (!initialized)
        {
            if (persistenceDelegator == null)
            {
                throw new LazyInitializationException("could not initialize proxy " + persistentClass.getName() + "_"
                        + id + " - no EntityManager");
            }
            else if (!persistenceDelegator.isOpen())
            {
                throw new LazyInitializationException("could not initialize proxy " + persistentClass.getName() + "_"
                        + id + " - the owning Session was closed");
            }
            else
            {
                if (log.isDebugEnabled())
View Full Code Here

TOP

Related Classes of com.impetus.kundera.proxy.LazyInitializationException

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.