Re: Tomee Hibernate Session JNDI

2012-06-13 Thread Romain Manni-Bucau
Maybe the easier is to extendq the mbean and register it yourself no? - Romain Le 14 juin 2012 04:56, "zeeman" a écrit : > This complete small snippet shows how to get it working with JPA and an EJB > container, but I don't know the steps needed for Tomee. The guide is for > Jboss. > > https://c

Re: Tomee Hibernate Session JNDI

2012-06-13 Thread zeeman
This complete small snippet shows how to get it working with JPA and an EJB container, but I don't know the steps needed for Tomee. The guide is for Jboss. https://community.jboss.org/wiki/HibernateStatisticsWithJPAUsingAMbean What is the equivalent on Tomee? Thanks! -PS Ya, I'm not sure why the

Re: CMP failed with 3 layered Object structure

2012-06-13 Thread Anthony Fryer
I may have misunderstood your current issue. It seems you are able to get a successful response if you call the getContactList().size() method before returning from your method. If that is the case then adding the @TransactionAttribute will probably not change anything. The issue you are having

Re: simple db-jpa-ejb-servlet

2012-06-13 Thread slawek
Solved, this was a problem - thank you! Best Regards sw -- View this message in context: http://openejb.979440.n4.nabble.com/simple-db-jpa-ejb-servlet-tp4655596p4655603.html Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: simple db-jpa-ejb-servlet

2012-06-13 Thread Romain Manni-Bucau
Hi, just to be sure: you call a remote ejb which returns a list of non serializable entities? - Romain 2012/6/13 slawek > Hello, > I'm trying to build simple test application with following structure: > servlet-ejb-jpa-database > Application works well, but when I try to call from servlet ejb

Re: Tomee Hibernate Session JNDI

2012-06-13 Thread Romain Manni-Bucau
here how to declare a resource: 1) create a META-INF/foo/service-jar.xml 2) put in: 3) implement SessionUnwrapper to unwrap the session 4) declare a resource of type defined in the previous file and provider="foo:my-id": 5) use jndi name: openejb/Resource/bar that's not "easy" but hi

Re: Tomee Hibernate Session JNDI

2012-06-13 Thread zeeman
I like it to be as simple as possible. The first option is easier. Is unwrapping the Hibernate session from EMF and setting it in JNDI would be done in Java code not xml files? But I don't see how is this going to work, because when app is deployed the EMF will be set. So I have to bind the sessio

simple db-jpa-ejb-servlet

2012-06-13 Thread slawek
Hello, I'm trying to build simple test application with following structure: servlet-ejb-jpa-database Application works well, but when I try to call from servlet ejb, witch call jpa I got error at servlet. Data from db is correctly return via jpa becouse I see it in ejb classs using simple System.o

Re: Deploying Pet-catalog

2012-06-13 Thread Jeremyau
Ok it works well! I did some small changes. (Annotation, JTA...) Thanks Romain! -- View this message in context: http://openejb.979440.n4.nabble.com/Deploying-Pet-catalog-tp4655421p4655597.html Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: DataSource tomee.xml

2012-06-13 Thread Romain Manni-Bucau
Can you configure the jta or not aspect in context.xml? Le 13 juin 2012 19:11, "Fernando Lozano" a écrit : > Hi, > > Why not in META-INF/context.xml ? > > Is there any difference betweeb context.xml and resources.xml? As TomEE is > supposed to "bet tomcat" I'd configure a datasource the tomcat wa

Re: DataSource tomee.xml

2012-06-13 Thread Fernando Lozano
Hi, Why not in META-INF/context.xml ? Is there any difference betweeb context.xml and resources.xml? As TomEE is supposed to "bet tomcat" I'd configure a datasource the tomcat way, unless I'm missing something. And by the way, can I configure other kinds of resources, say JMS destinations,

Re: DataSource tomee.xml

2012-06-13 Thread Romain Manni-Bucau
Put it in meta-inf/resources.xml Le 13 juin 2012 18:52, "José Luis Cetina" a écrit : > My web app is using the datasource that i set in tomee.xml like this: > > > JdbcDriver com.mysql.jdbc.Driver > JdbcUrl jdbc:mysql://localhost:3306/mydb > UserName myuser > Password mypass > JtaManaged tru

DataSource tomee.xml

2012-06-13 Thread José Luis Cetina
My web app is using the datasource that i set in tomee.xml like this: JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/mydb UserName myuser Password mypass JtaManaged true How can i set this configuration inside my app (not in the server)?

Re: Tomee Hibernate Session JNDI

2012-06-13 Thread Romain Manni-Bucau
The second needs to define a tomee resource (look dynamic datasource sample). Imo that's harder Le 13 juin 2012 17:02, "zeeman" a écrit : > I prefer the second option using resources.xml. What value would > openejb/Resource/nameUsed have to bind hibernate.session_factory_name in > JNDI? > > Sorry

Re: Tomee Hibernate Session JNDI

2012-06-13 Thread zeeman
I prefer the second option using resources.xml. What value would openejb/Resource/nameUsed have to bind hibernate.session_factory_name in JNDI? Sorry, I have not used this with Tomcat before. -- View this message in context: http://openejb.979440.n4.nabble.com/Tomee-Hibernate-Session-JNDI-tp4655

Re: CMP failed with 3 layered Object structure

2012-06-13 Thread georgenis
I am not @ work. If I am annotate this method, will I need still the getContacts().size()-method, to get no lazyLoading Exception? -- View this message in context: http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655588.html Sent from the OpenEJB User mai

Re: CMP failed with 3 layered Object structure

2012-06-13 Thread Anthony Fryer
Your haven't defined the transaction scope on your ejb methods. Try adding the annotation @TransactionAttribute(TransactionAttributeType.REQUIRED) to your getCustomer method... @Override @TransactionAttribute(TransactionAttributeType.REQUIRED) public Customer getCustomer(

Re: CMP failed with 3 layered Object structure

2012-06-13 Thread georgenis
No my contact class is just out of a few strings like "firstName, surName, street, city, zipcode, country and so on". -- View this message in context: http://openejb.979440.n4.nabble.com/CMP-failed-with-3-layered-Object-structure-tp4655311p4655582.html Sent from the OpenEJB User mailing list ar