Re: multithreaded repository issues
Thats nice :-) Yepp, I know, however I've been testing different scope on em's. Having @requestscoped em, each managed thread will use its own em proxy ref every cycle Having dependent, each managed thread will get a new em proxy ref. I have not yet been able to get the same on using DS repositories, so I'm very happy for any feedback, whatever they may be :-) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/multithreaded-repository-issues-tp4660132p4660166.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: multithreaded repository issues
Hi guys, made a simple project: https://github.com/hwaastad/DeltaDataPerformance.git two IT's one using em only and the other ds repository. Tune number of generated records in abstractContainerTest. Please mind that I've not made any timer interceptors for providing time, but then again both tests use the same strategy. It's just made for proving difference. Some details: TomEE 1.7.1 as container eclipselink 2.5.2 hsql embedded in tomee as db You may choose to use another db by changing datasource in container.properties. br, hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/multithreaded-repository-issues-tp4660132p4660152.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: multithreaded repository issues
Hi guys, and thanks for answering. I'll try to get something out on github tomorrow. Br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/multithreaded-repository-issues-tp4660132p4660145.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
multithreaded repository issues
Hi, I'm playing around with repositories and testing out multithreaded jpa transactions. I know discussions around em thread safety etc :-) Anyways, My current setup Im using managedexecutorservice and running 4 parallell jobs each store or merge an Set of entities. No duplicates. Runnable is using UserTransaction. DS 1.3.0 JTA and JTA em. If I'm only injecting em I never have issues. Using deltaspike, I get (and not always, but usually at merge): java.util.concurrent.ExecutionException: org.apache.deltaspike.data.api.QueryInvocationException: Failed calling Repository: [Repository=org.waastad.productcatalog.repository.FlatProductRepository,entity=org.waastad.entity.FlatProduct,method=findBy,exception=class org.apache.deltaspike.data.api.QueryInvocationException,message=Failed calling Repository: [Repository=org.waastad.productcatalog.repository.FlatProductRepository,entity=org.waastad.entity.FlatProduct,method=findBy,exception=class java.lang.NullPointerException,message=null . . . . java.lang.NullPointerException,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:57) at org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeNonTransactional(TransactionalQueryRunner.java:66) at org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeQuery(TransactionalQueryRunner.java:61) at org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:79) I can make you an example project if you're interested. I'm probably pushing jpa since im importing ~1.5 mill in batch jobs, but as I was sayingI'am testing :-) BTW, penalty using repositories are quite high compared to only using em (~50% )...which probably is as expected, not? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/multithreaded-repository-issues-tp4660132.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
Hi TH, Ok I've tried to be as explicit as I could: https://issues.apache.org/jira/browse/DELTASPIKE-759 If anything else is needed, I'll do whatever I can. I do really want this to be OK :-) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659307.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
OK, after going back to my ear project I still have an issue using repositories and CMT. (war is OK) versions <1.0.3 is ok. 1.0.3 is not. 1. method expressions are working 2. @Query annotation is working 3. All abstract functions (find/save/findall etc etc) are not working I have a simple ear project using tomee 1.7.1 plus. If needed, I can publish it to github. Can I file an issue in JIRA? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659297.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
Ah, maybe a servletcontextlistener(?). I'll check it out. Thanks! br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659296.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
Hi, just wanted to let you know I found out whats causing this particular issue. I had a @startup @singleton creating a intervaltimer in my war (part of ear) which had a little too short initialduration, so it was firering during container startup. increasing the initial delay made the error message go away. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659294.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
OK guys, after getting DS source and checking the test persistence being used for openjpa, i noticed the option: openejb.jpa.init-entitymanager So, I figured out the equivalent for eclipselink: eclipselink.deploy-on-startup Now, the entitymanager producer works OK. However, am I barking up the wrong tree here wanting it to work using default persistence configuration? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659293.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
Hi, just to add some ingredience to the puzzel: Switching to openjpa-2.3.0 it works without using entitymanagerconfig...and @PersitenceContext in producer. hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659292.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
Right, so it mean I might use persitenceunit in producer to create a application managed entitymanager and still use JTA. You mentioned you did not think it could be a DS issue. Maybe Mark og Romain could comment? Romain commented earlier that maybe a custom transactionstrategy should be used (maybe by Specializing), but I yet do not know how. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659290.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy issue
Hi TH, I know it'll work using PersistenceUnit but then again are'nt I using a resource_local em? I try to read the specs regarding JTA and somewhere I read: "You are not allowed to use @PersistenceUnit to refer to a unit of type JTA" I will happily help debugging this issue, but I'm a little bit over my head when it comes to debugging DS code. If you have any recommendations, I'll start digging further. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285p4659287.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
ContainerManagedTransactionStrategy issue
Hi, I need some help understanding how Deltaspike handles entitymanager lookup. (I've made this post since the issue I've been struggeling with these last couple og days actually are a result on how DS is handling CMT) I've made a test project: https://github.com/hwaastad/DeltaDataTest.git - JTA in persistence.xml - CMT em producer - ContainerManagedTransactionStrategy in beans.xml This is a simple MDB persisting a dummy entity. 1. save(entity) will fail 2. findall() and the save(entity) is working. Why is 1. failing? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-issue-tp4659285.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
Hi, I found out that I have issues with JMS aswell using repositories and CM JTA. https://github.com/hwaastad/DeltaDataTest.git entitymanager obviously fails. There is a test, JmsTest which just pushes a message to the queue and the jmslistener uses a repository to write the object. repository uses a entitymanager resolver and the test is ok. remove entitymanagerconfig from repository and it will fail. (injecting em into repository and do em.persist is also OK) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659273.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
Tried now to inject enittymanager and that works fine. jta em. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659249.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
I really try to reproduce this:-| anyway, did a try-catch around the createnamedquery: Caused by: org.apache.deltaspike.data.api.QueryInvocationException: Failed calling Repository: [Repository=org.waastad.repository.ZoneLocaleTextRepository,entity=org.waastad.entity.TZoneLocaleText,method=entityManager,exception=class org.apache.deltaspike.data.api.QueryInvocationException,message=Failed calling Repository: [Repository=org.waastad.repository.ZoneLocaleTextRepository,entity=org.waastad.entity.TZoneLocaleText,method=entityManager,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:57) at org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeNonTransactional(TransactionalQueryRunner.java:66) at org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeQuery(TransactionalQueryRunner.java:61) at org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:79) ... 192 more Caused by: org.apache.deltaspike.data.api.QueryInvocationException: Failed calling Repository: [Repository=org.waastad.repository.ZoneLocaleTextRepository,entity=org.waastad.entity.TZoneLocaleText,method=entityManager,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) ... 196 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:117) at org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:97) ... 197 more Caused by: java.lang.NullPointerException at org.apache.deltaspike.data.impl.handler.EntityRepositoryHandler.entityManager(EntityRepositoryHandler.java:192) ... 203 more This is maybe missing transaction? service calling repository even has require_new on method calling repository. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659247.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
I think I finally figured it out. somewhere in my repositories I did a lookup like this: @repository public abstract extends abstactentityrepository<> public function(){ Query query = this.entityManager().createNamedQuery() .. .. } this one fails (silently) EL Info]: 2014-10-26 13:48:17.771--ServerSession(1948558493)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd is NOT to be seen. If i make it an abstract running @query its ok. right now I do not now why. could someone share some light on why this might happen? btw, jta in persistence.xml and producer: @ApplicationScoped public class EntityManagerProducer { @PersistenceContext(unitName = "demoPU") private EntityManager entityManager; @Produces public EntityManager create() { return entityManager; } } I think I'll be able to make a test project. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659239.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
OK, another step forward. I belive it might be caused by ear packaging. My ear will have ds libs in /lib (not core-impl though) I'm using tomee jars plugin so core-api/core-impl will also bee in web-app. If I make make ear with "traditional" skinny wars it's with all jars is ear/lib it's ok. Now, I have'nt been able to reproduce yet, but something in my production code is generating the issue. I'll still try to force one. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659235.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
I've made som progress. It might be the result of a timerservice. I'ts implemented as @singleton @startup . . @Resource private TimerService timerService; @Inject @RemoteEJB thisEjb; I'm producing remote ejbs, using ejb-refs in web.xml. I will do some more testing. Right now everything goes haywire just by removing @startup... I'll update this post when I'm a bit closer to any good analysis. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659223.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
In my quest now to find this issue, i've noticed that in my project having this issue this is found in logs: org.apache.deltaspike.jsf.impl.config.view.ViewConfigPathValidator contextInitialized and then the error. In my other project which I'm trying to reproduce the issue, I cannot see this message.yet, anyway. Just wonder why I don't see this br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659221.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: IllegalStateException 1.0.2 -> 1.0.3
OK, I'll try to reproduce my production code in a demo project. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216p4659218.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
IllegalStateException 1.0.2 -> 1.0.3
Hi, I have a project which fails when upgrading ds from 1.0.2 - > 1.0.3 Does anyone have a clue why? primefaces 5.1.1 tomee 1.7.1 br hw java.lang.IllegalStateException: Could not find beans for Type=class org.apache.deltaspike.jsf.api.config.JsfModuleConfig and qualifiers:[] org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:150) org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeFacesContextWrapper.init(DeltaSpikeFacesContextWrapper.java:146) org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeFacesContextWrapper.lazyInit(DeltaSpikeFacesContextWrapper.java:136) org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeFacesContextWrapper.broadcastDestroyedJsfRequestEvent(DeltaSpikeFacesContextWrapper.java:125) org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeFacesContextWrapper.release(DeltaSpikeFacesContextWrapper.java:96) org.primefaces.context.PrimeFacesContext.release(PrimeFacesContext.java:28) javax.faces.webapp.FacesServlet.service(FacesServlet.java:235) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/IllegalStateException-1-0-2-1-0-3-tp4659216.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy
Hi, no, the same error happens. br hw - Producing entitymanager. SEVERE - EjbTransactionUtil.handleSystemException: java.lang.NullPointerException javax.persistence.PersistenceException: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getIdentifier(EntityManagerFactoryDelegate.java:719) at org.apache.deltaspike.data.impl.handler.CdiQueryInvocationContext.isNew(CdiQueryInvocationContext.java:93) at org.apache.deltaspike.data.impl.handler.EntityRepositoryHandler.save(EntityRepositoryHandler.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:117) at org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.invoke(DelegateQueryBuilder.java:97) at org.apache.deltaspike.data.impl.builder.DelegateQueryBuilder.execute(DelegateQueryBuilder.java:57) at org.apache.deltaspike.data.impl.builder.QueryBuilder.executeQuery(QueryBuilder.java:57) at org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner$1.proceed(TransactionalQueryRunner.java:77) at org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy.execute(ContainerManagedTransactionStrategy.java:40) 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) at org.apache.deltaspike.partialbean.impl.PartialBeanAbstractMethodHandler.invoke(PartialBeanAbstractMethodHandler.java:44) at org.apache.deltaspike.partialbean.impl.MethodHandlerProxy.invoke(MethodHandlerProxy.java:35) at com.sun.proxy.$Proxy112.invoke(Unknown Source) at org.waastad.tomeedsvalidation.repository.CustomerRepository_$$_javassist_1.save(CustomerRepository_$$_javassist_1.java) at org.waastad.tomeedsvalidation.ejb.BusinessBean.save(BusinessBean.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181) at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192) at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173) at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85) at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227) at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:308) at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:303) at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:92) at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:308) at org.waastad.tomeedsvalidation.ejb.BusinessBean$$LocalBeanProxy.save(org/waastad/tomeedsvalidation/ejb/BusinessBean.java) at org.waastad.tomeedsvalidation.entity.CustomerTest.test12(CustomerTest.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method
Re: ContainerManagedTransactionStrategy
Hi, those two are just for enabling result query cache by default on namedqueries and flush on commit (needed for using lookups in custom validators, if not setting flushmode on entitymanager, that is...) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-tp4659084p4659104.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: ContainerManagedTransactionStrategy
Hi TH, and thanks for answering. I'm running JTA datasource and running repository within an EJB transaction. However, what I found out is that I need the entoitymanagerconfig with resolver or else this error occurs. I've made a simple test project (https://github.com/hwaastad/TomeeDsValidation.git) So if you remove the @EntityManagerConfig(entityManagerResolver = CrmEntityManagerResolver.class,flushMode = FlushModeType.COMMIT) Then this error will occure. Any idea why? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-tp4659084p4659102.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
ContainerManagedTransactionStrategy
Hi, i was wondering if there is any doc on the usage of ContainerManagedTransactionStrategy? I've been trying to add this in beans.xml, but I only get a: javax.persistence.PersistenceException: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getIdentifier(EntityManagerFactoryDelegate.java:719) at org.apache.deltaspike.data.impl.handler.CdiQueryInvocationContext.isNew(CdiQueryInvocationContext.java:93) . . . Caused by: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getIdentifier(EntityManagerFactoryImpl.java:85) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getIdentifier(EntityManagerFactoryDelegate.java:715) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ContainerManagedTransactionStrategy-tp4659084.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: JPA doc related to EM Producer
Hi, DS doc specifies the use of BeanManagedUserTransactionStrategy in beans.xml. Should'nt that be enough? ..or containermanaged strategy? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/JPA-doc-related-to-EM-Producer-tp4658999p4659081.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: JPA doc related to EM Producer
Hi, I've tried but realized an issue when using deltaspike and cdi injection in custom validators. the entity is flushed before validation is run and hence will fail. I made a test project on github (https://github.com/hwaastad/TomeeDsValidation.git) and u'll see that validation fails if the entitymanager is produced like this. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/JPA-doc-related-to-EM-Producer-tp4658999p4659079.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: JPA doc related to EM Producer
Hi, maybe a little late on this but I've been testing differet scenarios using tomee and deltaspike and using JTA these are the ones I found out working: @Produces @ApplicationScoped public EntityManagerFactory createEntityManagerFactory() { System.out.println("Producing EMF.."); return Persistence.createEntityManagerFactory("ValidationPU"); } @Produces public EntityManager createEntityManager(EntityManagerFactory entityManagerFactory) { System.out.println("Producing entitymanager."); return entityManagerFactory.createEntityManager(); } with a little help from @romain i realized that my em's were resource_local using the producer shown in the DS docs. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/JPA-doc-related-to-EM-Producer-tp4658999p4659077.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: Repository save duplicate key
Hi, I'm happy to see that a discussion has been started. I'm +1 on having a "insert/persist" method by default in DS and I look forward to see what U guys think is best. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Repository-save-duplicate-key-tp4659067p4659076.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: Repository save duplicate key
Hi, and thanks for answering. I'm extending the abstractentityrepository so I'll start testing override on the save method or just adding another method. If that does'nt suit my needs, I'll have a closer look at the entitymanagerdelegate. thanks again, br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Repository-save-duplicate-key-tp4659067p4659069.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Repository save duplicate key
Hi, Hi, just a question regarding save on duplicate primaries. I have an entity with @id String id eks: User @id String id String name User a = new User("id-1","name-1") User a2 = new User("id-1","name-2") save(a) - OK save(a2) - updates entity a So, If I want save(a2) to throw an exception on duplicate primary is it best to use the entitymanagerdelegate or add a contraintvalidator on primary? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Repository-save-duplicate-key-tp4659067.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: "mocking" of abstractentityrepository implementations
Hi, and thanks again TH. I'll begin my quest :-) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/mocking-of-abstractentityrepository-implementations-tp4658745p4658777.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: "mocking" of abstractentityrepository implementations
Hi, always looking out for a better way to build my tests :-) mocking, well sometimes I just need mock for throwing exceptions and anomality. Now, I know arquillian is a powerful framework and I guess you can dynamically assign alternatives/stereotypes aswell by defining this with a addasmanifestresource/beans.xml/stringasset. I guess I just got to roll up my sleaves and do a bit more investigation on the persistence extension. I someone has a link or to I would be most greateful :-) I know Romain wrote something about this in his blog,though. Well guys, thanks a lot for feedback. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/mocking-of-abstractentityrepository-implementations-tp4658745p4658766.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: "mocking" of abstractentityrepository implementations
Hi, yes it's for testing only. I'm running openjb embedde (4.7.0) and I can define projectstage in container properties. I've been using @excludes for my SLSB to mock underlying business API's and I was hoping to use the same approch with my repositories. I'll have a look at the partialbindingextension aswell. br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/mocking-of-abstractentityrepository-implementations-tp4658745p4658751.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: "mocking" of abstractentityrepository implementations
HI, and thanks for answering. Based on what you mentioned, i made a deactivator an registered it in my properties so the log shows: INFO - class: org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension activated=true INFO - class: org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension activated=true INFO - class: org.apache.deltaspike.core.impl.exclude.CustomProjectStageBeanFilter activated=true INFO - class: org.apache.deltaspike.core.impl.exclude.GlobalAlternative activated=true INFO - class: org.apache.deltaspike.data.impl.RepositoryExtension activated=false INFO - class: org.apache.deltaspike.partialbean.impl.PartialBeanBindingExtension activated=true INFO - class: org.apache.deltaspike.core.impl.config.ConfigurationExtension activated=true INFO - class: org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension activated=true INFO - class: org.apache.deltaspike.core.impl.message.MessageBundleExtension activated=true INFO - class: org.apache.deltaspike.core.impl.message.NamedMessageBundleInvocationHandler activated=true INFO - class: org.apache.deltaspike.core.impl.jmx.MBeanExtension activated=true INFO - class: org.apache.deltaspike.jpa.impl.transaction.context.TransactionContextExtension activated=true It seems it does not really matter. A bit more info: public abstract class TestRepository extends AbstractEntityRepository. public abstract class MockTestRepository extends TestRepository br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/mocking-of-abstractentityrepository-implementations-tp4658745p4658750.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
"mocking" of abstractentityrepository implementations
Hi, I'm trying to mock out abstract repositories in different project stages. I can extend my repository (in test classes) and use alternative/stereotype, but excluding does not seem to work then. Is this possible? br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/mocking-of-abstractentityrepository-implementations-tp4658745.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Deltaspike 0.7 EAR skinny wars deployment
Hi, after testing TomEE 1.7.0-SNAPSHOT and deltaspike another issue has occured: http://openejb.979440.n4.nabble.com/TomEE-1-7-0-and-Deltaspike-0-7-td4669822.html I've made a very short demo project as seen in the post. I'm aware that currently the deltaspike modules "should" be deployed in each war, but my question is: is this at all possible right now or is it something that could be resolved in the future? (I've read the instructions/limitiations regarding EAR deployment on your site) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Deltaspike-0-7-EAR-skinny-wars-deployment-tp4657840.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: Deltaspike 0.7 Facesconverter
I can verify that it works adding a custom jsfmoduleconfig. Now I just have to figure out how this will work out in an ear ...or wait a coulple of weeks until tomee 1.7.0 is out :-) br hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Deltaspike-0-7-Facesconverter-tp4657834p4657837.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Re: Deltaspike 0.7 Facesconverter
Thanks alot, I'll try your suggestions. best regards, hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Deltaspike-0-7-Facesconverter-tp4657834p4657836.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.
Deltaspike 0.7 Facesconverter
Hi, I hope this is the right forum(was not able to register with the user forum) FacesConterverter: @FacesConverter(forClass = String.class) public class StringTrimmer implements Converter{ @Override public Object getAsObject(FacesContext fc, UIComponent uic, String string) throws ConverterException { return string != null ? string.trim() : null; } @Override public String getAsString(FacesContext fc, UIComponent uic, Object o) throws ConverterException { return (String) o; } } Generates a: java.lang.NullPointerException org.apache.deltaspike.jsf.impl.injection.AbstractBeanStorage.add(AbstractBeanStorage.java:35) org.apache.deltaspike.jsf.impl.injection.RequestDependentBeanStorage.add(RequestDependentBeanStorage.java:24) org.apache.deltaspike.jsf.impl.injection.ManagedArtifactResolver.getContextualReference(ManagedArtifactResolver.java:87) org.apache.deltaspike.jsf.impl.injection.ManagedArtifactResolver.resolveManagedConverter(ManagedArtifactResolver.java:53) org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.managedOrDefaultConverter(InjectionAwareApplicationWrapper.java:74) org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.createConverter(InjectionAwareApplicationWrapper.java:54) org.primefaces.config.ConfigContainer.initConfig(ConfigContainer.java:99) org.primefaces.config.ConfigContainer.(ConfigContainer.java:81) org.primefaces.context.DefaultApplicationContext.(DefaultApplicationContext.java:35) org.primefaces.context.DefaultRequestContext.getApplicationContext(DefaultRequestContext.java:227) org.primefaces.metadata.ComponentMetadataTransformerListener.processEvent(ComponentMetadataTransformerListener.java:40) javax.faces.event.SystemEvent.processListener(SystemEvent.java:43) org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2493) org.apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:120) org.apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2684) org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:601) org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:616) javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336) javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336) javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336) org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:121) org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:283) org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170) org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89) javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) best regards, hw -- View this message in context: http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Deltaspike-0-7-Facesconverter-tp4657834.html Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at Nabble.com.