*The unit test console log just displays -*
Jul 10, 2015 3:14:46 PM
org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener
testFailure
INFO: [failed]
test.com.myApp.it.test.CascadeTestWithRepository#createBookingWithRepository
message: Failed calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
org.apache.deltaspike.data.api.QueryInvocationException,message=Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
org.apache.deltaspike.data.api.QueryInvocationException,message=Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
java.lang.reflect.InvocationTargetException,message=null
Jul 10, 2015 3:14:46 PM
org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener
testFinished
INFO: [finished]
test.com.myApp.it.test.CascadeTestWithRepository#createBookingWithRepository



*The stack trace has this-*

org.apache.deltaspike.data.api.QueryInvocationException: Failed calling
Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
org.apache.deltaspike.data.api.QueryInvocationException,message=Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
org.apache.deltaspike.data.api.QueryInvocationException,message=Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
java.lang.reflect.InvocationTargetException,message=null
        at
org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:91)
        at
org.apache.deltaspike.proxy.impl.invocation.DelegateManualInvocationHandler.proceedOriginal(DelegateManualInvocationHandler.java:46)
        at
org.apache.deltaspike.proxy.impl.invocation.AbstractManualInvocationHandler.invoke(AbstractManualInvocationHandler.java:63)
        at
org.apache.deltaspike.proxy.impl.invocation.DelegateManualInvocationHandler.staticInvoke(DelegateManualInvocationHandler.java:39)
        at
com.myApp.entities.BookingRepository$$DSPartialBeanProxy.saveAndFlush(Unknown
Source)
        at
test.com.myApp.it.test.CascadeTestWithRepository.createBookingWithRepository(CascadeTestWithRepository.java:39)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.invokeMethod(CdiTestRunner.java:340)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareMethodInvoker.evaluate(CdiTestRunner.java:312)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:174)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.runChild(CdiTestRunner.java:75)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:366)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:392)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:141)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.deltaspike.data.api.QueryInvocationException: Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
org.apache.deltaspike.data.api.QueryInvocationException,message=Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
java.lang.reflect.InvocationTargetException,message=null
        at
org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.execute(DelegateQueryBuilder.java:66)
        at
org.apache.deltaspike.data.impl.builder.QueryBuilder.executeQuery(QueryBuilder.java:59)
        at
org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner$1.proceed(TransactionalQueryRunner.java:77)
        at
org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:133)
        at
org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeTransactional(TransactionalQueryRunner.java:72)
        at
org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeQuery(TransactionalQueryRunner.java:54)
        at
org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:79)
        ... 33 more
Caused by: org.apache.deltaspike.data.api.QueryInvocationException: Failed
calling Repository:
[Repository=com.myApp.entities.BookingRepository,entity=com.myApp.entities.Booking,method=saveAndFlush,exception=class
java.lang.reflect.InvocationTargetException,message=null
        at
org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:105)
        at
org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.execute(DelegateQueryBuilder.java:57)
        ... 39 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at
org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:117)
        at
org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:97)
        ... 40 more
Caused by: java.lang.IllegalStateException: During synchronization a new
object was found through a relationship that was not marked cascade PERSIST:
com.myApp.entities.Adventure@68c27ee3.
        at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:303)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:706)
        at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:431)
        at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:798)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at
org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:40)
        at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
        at
org.jboss.weld.proxies.EntityManager$90655291$Proxy$_$$_WeldClientProxy.flush(Unknown
Source)
        at
org.apache.deltaspike.data.impl.handler.EntityRepositoryHandler.flush(EntityRepositoryHandler.java:209)
        at
org.apache.deltaspike.data.impl.handler.EntityRepositoryHandler.saveAndFlush(EntityRepositoryHandler.java:83)
        ... 46 more





--
View this message in context: 
http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Cascade-persist-and-merge-with-Repository-tp4661002p4661041.html
Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at 
Nabble.com.

Reply via email to