Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Daniel Cunha
If I get it.. You need to have something like DeltaSpike ProjectStage[1] where you have a configuration for Development and another configuration for Production. So, maybe you can create a different Produce for each stage. Then with Alternative and Exclude annotations you can configure it. I'm

Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Felipe Jaekel
Hi, Persistence is working fine... My demand is to enable hibernate's generated sql output only when the webapp is running locally. persistence.xml is not an option because I cannot afford to forget this setting enabled and send the webapp to production with it, since the server will run out of

How to persist object using Entity Manager and GenericDao Bean and Tomee

2015-07-17 Thread coco
I m in the beginning with Java EJB. :) I have Dynamic web project in eclipce and i want to save object to mysql database. Dont understand why it is not working since i do not have exceptions in my console. I m using Apache Tomee server wich i had installed in eclipse. My Entity class:

Re: How to persist object using Entity Manager and GenericDao Bean and Tomee

2015-07-17 Thread Leonardo K. Shikida
actually, it seems something is being inserted somewhere TRACE [http-bio-8080-exec-7] openjpa.jdbc.SQL - t 1249135181, conn 1798001212 executing prepstmnt 1563539472 INSERT INTO PUBLIC.books (ID, NAME) VALUES (?, ?) [params=?, ?] isn't something related to the autocommit? [] Leo On Fri,

The name EntityName is not a recognized entity or identifier. Known entity names: []

2015-07-17 Thread Patel, Sanjay
I am able to run my project on standalone Tomee but I get below error if I run project in Tomee in eclipse. Any idea? Caused by: openjpa-2.2.0-r422266:1244990 nonfatal user error org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter select query.

Re: The name EntityName is not a recognized entity or identifier. Known entity names: []

2015-07-17 Thread Romain Manni-Bucau
Hi If you use JPA scanning then eclipse maybe just messed up the classloader Romain Manni-Bucau @rmannibucau https://twitter.com/rmannibucau | Blog http://rmannibucau.wordpress.com | Github https://github.com/rmannibucau | LinkedIn https://www.linkedin.com/in/rmannibucau | Tomitriber

Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Romain Manni-Bucau
Well I'd just put the properties I want in conf/system.properties. Side note: if you want to do it by persistence unit you can as well prefixing it by PERSISTENCEUNIT and the unit name as explained here http://tomee.apache.org/properties-listing.html Romain Manni-Bucau @rmannibucau

Re: How to persist object using Entity Manager and GenericDao Bean and Tomee

2015-07-17 Thread Romain Manni-Bucau
Hi Maybe check your logs to ensure you use the datasource you expect. You can also check connecting through JMX to tomee in openejb MBeans. Romain Manni-Bucau @rmannibucau https://twitter.com/rmannibucau | Blog http://rmannibucau.wordpress.com | Github https://github.com/rmannibucau | LinkedIn

Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Yann Blazart
And yes that's working too, but only for TomEE ;) I'm using this in my units tests with app composer (thanks Romain !) Well I'd just put the properties I want in conf/system.properties. Side note: if you want to do it by persistence unit you can as well prefixing it by PERSISTENCEUNIT and the

Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Felipe Jaekel
Adding *hibernate.show_sql=true* and *hibernate.format_sql=true* to *system.properties* did the trick Thank you all 2015-07-17 14:05 GMT-03:00 Yann Blazart yann.blaz...@bycode.fr: And yes that's working too, but only for TomEE ;) I'm using this in my units tests with app composer (thanks

Re: Conditional properties to EntityManagerFactory

2015-07-17 Thread Yann Blazart
Hello ! I made a such thing for one client. In facts and brievly, I made a persistence provider that was able to load propperties and create a delegated real persistence provider (hibernate for example). In my persistence.xml I refered to my own persistence provider. In this way I'm able to

Re: Migrating a resource adapter from glassfish to TomEE

2015-07-17 Thread Romain Manni-Bucau
Hi Using class-name in Resource declaration should make it. That said ra name as logged.property =value in conf/system.properties should work IIRC. Le 17 juil. 2015 20:32, Mike Spencer mspen...@denniskirk.com a écrit : Hi all, I am trying to migrate an application using a resource adapter

Migrating a resource adapter from glassfish to TomEE

2015-07-17 Thread Mike Spencer
Hi all, I am trying to migrate an application using a resource adapter in a .rar file from Glassfish to TomEE. The resource adapter needs to be deployed globally (so multiple application can access it) and make the javax.resource.cci.ConnectionFactory implementation available via JNDI. I

Re: Migrating a resource adapter from glassfish to TomEE

2015-07-17 Thread Mike Spencer
Hi Romain, Using class-name allowed it to get past the 'Cannot determine a provider' message, but now I am encountering a new error. This error occurs when using Resource id=ra-jrac class-namejavax.resource.cci.ConnectionFactory/Resource in tomee.xml: SEVERE: FATAL ERROR: Unknown error in

Re: Migrating a resource adapter from glassfish to TomEE

2015-07-17 Thread Romain Manni-Bucau
2015-07-17 12:48 GMT-07:00 Mike Spencer mspen...@denniskirk.com: Hi Romain, Using class-name allowed it to get past the 'Cannot determine a provider' message, but now I am encountering a new error. This error occurs when using Resource id=ra-jrac