Re: multithreaded repository issues

2015-03-16 Thread hwaastad
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

multithreaded repository issues

2015-03-14 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy issue

2014-10-29 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy issue

2014-10-29 Thread hwaastad
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:

ContainerManagedTransactionStrategy issue

2014-10-28 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy issue

2014-10-28 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy issue

2014-10-28 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy issue

2014-10-28 Thread hwaastad
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:

Re: ContainerManagedTransactionStrategy issue

2014-10-28 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-28 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-28 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-27 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-26 Thread hwaastad
I think I finally figured it out. somewhere in my repositories I did a lookup like this: @repository public abstract respoitory extends abstactentityrepository public function(){ Query query = this.entityManager().createNamedQuery() .. .. } this one fails (silently) EL Info]: 2014-10-26

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-26 Thread hwaastad
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:

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-26 Thread hwaastad
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

IllegalStateException 1.0.2 - 1.0.3

2014-10-25 Thread hwaastad
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:[]

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-25 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-25 Thread hwaastad
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

Re: IllegalStateException 1.0.2 - 1.0.3

2014-10-25 Thread hwaastad
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

Re: ContainerManagedTransactionStrategy

2014-10-06 Thread hwaastad
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:

Re: ContainerManagedTransactionStrategy

2014-10-06 Thread hwaastad
Hi, no, the same error happens. br hw - Producing entitymanager. SEVERE - EjbTransactionUtil.handleSystemException: java.lang.NullPointerException javax.persistence.PersistenceException: java.lang.NullPointerException at

Re: ContainerManagedTransactionStrategy

2014-10-05 Thread hwaastad
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

Re: JPA doc related to EM Producer

2014-10-03 Thread hwaastad
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

Re: JPA doc related to EM Producer

2014-10-03 Thread hwaastad
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

Re: JPA doc related to EM Producer

2014-10-03 Thread hwaastad
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:

ContainerManagedTransactionStrategy

2014-10-03 Thread hwaastad
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

Repository save duplicate key

2014-10-02 Thread hwaastad
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

Re: Repository save duplicate key

2014-10-02 Thread hwaastad
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:

Re: Repository save duplicate key

2014-10-02 Thread hwaastad
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:

Re: mocking of abstractentityrepository implementations

2014-09-03 Thread hwaastad
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

Re: mocking of abstractentityrepository implementations

2014-09-02 Thread hwaastad
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:

Re: mocking of abstractentityrepository implementations

2014-09-02 Thread hwaastad
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

Deltaspike 0.7 Facesconverter

2014-06-03 Thread hwaastad
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