From dev-return-4681-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Jun 28 11:38:12 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 69523 invoked from network); 28 Jun 2007 11:38:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 11:38:11 -0000 Received: (qmail 17755 invoked by uid 500); 28 Jun 2007 11:38:14 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 17722 invoked by uid 500); 28 Jun 2007 11:38:13 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 17713 invoked by uid 99); 28 Jun 2007 11:38:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 04:38:13 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 04:38:09 -0700 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1I3sJo-0006FR-Hl for dev@openjpa.apache.org; Thu, 28 Jun 2007 04:37:48 -0700 Message-ID: <11341475.post@talk.nabble.com> Date: Thu, 28 Jun 2007 04:37:48 -0700 (PDT) From: "Sreedhar.sirigiri" To: dev@openjpa.apache.org Subject: Re: Using OpenJPA within an "old" J2EE1.4 container with managed transactions? In-Reply-To: <46825117.6030303@Sun.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: sreedhar.sirigiri@gmail.com References: <004701c74961$0c557150$0600a8c0@burns> <2FB49DFF-B7B8-4F02-AE54-6C63A01E002E@apache.org> <005e01c74967$b137c5f0$0600a8c0@burns> <7D856CDFE035FF45A0420ACBD71BDD63031EAFEF@repbex02.amer.bea.com> <11300537.post@talk.nabble.com> <46825117.6030303@Sun.COM> X-Virus-Checked: Checked by ClamAV on apache.org Hi Sahoo, I could not test with your comments yesterday as I had to leave early. I modified the code accordingly. There is a small change in the code snippet. instead of TransactionManager = I used UserTransaction and it worked. UserTransaction utx =3D UserTransaction.class.cast(new InitialContext().lookup("java:comp/UserTransaction")); Thanks a lot for the help. Sreedhar Sahoo wrote: >=20 > Hi Sreedhar, >=20 > I think there is a misunderstanding about "container managed=20 > transaction(CMT)." In a pure Java EE (true for all previous J2EE=20 > containers as well), only *EJBs* are allowed to use container managed=20 > transaction feature. It saves the EJB programmer from marking=20 > transaction boundaries explicitly; each business method is implicitly=20 > used as a transaction boundary. There is no such facility for non-EJB=20 > components in a Java EE container. So, a programmer has to specify the=20 > transaction boundary explicitly. *javax.transaction.UserTransaction*[1],= =20 > which is part of JTA, is the API that is typically used to do this.=20 > Since Java Persistence API can be used in environment where JTA may not= =20 > be supported, it also supports an alternative API, called=20 > *EntityTransaction*[2], to control transactions. This API does not have= =20 > to be used in a container environment which supports JTA. /In fact, the= =20 > method EntityManager.getTransaction() which gives you access to the=20 > EntityTransaction object should not be even called for an EntityManager= =20 > with transaction-type JTA [3]/. By now it should be clear as to why that= =20 > exception was thrown by OpenJPA. As Marc suggested, you should *stop*=20 > using getTransaction() as you have configured persistence.xml to JTA=20 > transaction-type. >=20 > There is another concept that can play a role here for a JTA=20 > transaction-type entity manager. There is another classification of=20 > entity managers. Depending on how an entity manager is obtained in code,= =20 > it can be either be *application managed* or *container managed* entity= =20 > manager. I see the subject line saying "J2EE1.4", so I am assuming that= =20 > you can't use container managed entity manager. It is very likely that=20 > you are using *EntityManagerFactory.createEntityManager()* to get hold=20 > of an entity manager. Let us know if you are not using such an API. Such= =20 > an entity manager is of type application managed. Such an entity manager= =20 > does not *automatically* participate in a transaction which begins=20 > *after* the entity manager is created. One needs to call=20 > *EntityManager.joinTransaction()*. You may *not* be doing this in your=20 > code. Please check this. >=20 > I don't know your code well, so I don't know if you are using=20 > EntityManager in an EJB with container managed transaction or not. If=20 > yes, see if you need to use joinTransaction(). If *not*, then you should= =20 > code something like this: >=20 > //Get hold of UserTransaction object. In Java EE 5, you can use=20 > injection to avoid JNDI lookup. See [4] > UserTransaction utx =3D UserTransaction.class.cast(new=20 > InitialContext().lookup("java:comp/TransactionManager")); > utx.begin(); > entityManager.joinTransaction(); > entityManager.persist... > utx.commit(); >=20 > If this does not help, you have to provide more specific code that shows= =20 > how you create and use EntityManager. >=20 > Thanks, > Sahoo >=20 > [1]=20 > http://java.sun.com/javaee/5/docs/api/javax/transaction/UserTransaction.h= tml > [2]=20 > http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityTransaction= .html > [3]=20 > http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.htm= l#getTransaction() > [4]=20 > http://weblogs.java.net/blog/ss141213/examples/blog1/web-app1/src/example= /RegistrationServlet.java >=20 > Sreedhar.sirigiri wrote: >> Hello Patrick, >> >> When I specify the following properties in persistence.xml, I get the >> following exception.=20 >> "You cannot access the EntityTransaction when using managed transactions= " >> >> persistence.xml >> >> =09 >> org.apache.openjpa.persistence.PersistenceProviderImpl >> >> =20 >> =09java:/AuditDS =20 >> >> com.vormetric.server.dao.audit.MessageDTO >> >> =09 >> =09=09> value=3D"DatabaseName=3DLOGDB"> >> =09=09> value=3D"COM.ibm.db2.jdbc.DB2DataSource"/> >> =09=09 >> =09=09 >> =09=09> value=3D"jndi(TransactionManagerName=3Djava:/TransactionManager)"/> >> =09=09 >> =09=09 >> =20 >> =09=09= =09=09=09 >> =09=09 >> =09 >> >> >> In my DAOImpl.java I'm explicitly handling transactions by calling >> session.getTransaction().begin() and session.getTransaction().commit();= =20 >> When the trasaction-type is JTA and TransactionMode=3D"managed" why do w= e >> need >> to handle the transactions programatically?? Do I need to do something >> else >> for the container to handle transactions? >> >> When I modify the TransactionMode=3D"local" and call the begin & commit >> methods, I'm able to update/insert/delete. Kindly help. How can we use >> container managed transactions in OpenJPA. I'm not using any EJB's in my >> project. >> >> Sreedhar >> >> >> >> >> Patrick Linskey wrote: >> =20 >>> Looking at the trace, it looks like OpenJPA is being deployed correctly >>> when you used java:comp/UserTransaction: >>> >>> =20 >>>> 156 INFO [RMI TCP Connection(7)-192.168.0.6] openjpa.Runtime - >>>> Starting OpenJPA 0.9.6-incubating >>>> =20 >>> This means that OpenJPA loaded the configuration and initialized. >>> >>> =20 >>>> 359 INFO [RMI TCP Connection(7)-192.168.0.6] openjpa.jdbc.JDBC -=20 >>>> OpenJPA will now connect to the database to attempt to determine=20 >>>> what type of database dictionary to use. To prevent this connection= =20 >>>> in the future, set your openjpa.jdbc.DBDictionary configuration=20 >>>> property to the appropriate value for your database (see the=20 >>>> documentation for available values). >>>> 469 INFO [RMI TCP Connection(7)-192.168.0.6] openjpa.jdbc.JDBC -=20 >>>> Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary"= =20 >>>> (MySQL 5.0.27-community-nt ,MySQL-AB JDBC Driver mysql-connector- >>>> java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $,=20 >>>> $Revision: 5908 $ )). >>>> =20 >>> This means that we were able to connect to the database and figure out >>> that you're using MySQL. >>> >>> =20 >>>> org.apache.openjpa.persistence.InvalidStateException: >>>> You cannot access the EntityTransaction when using managed >>>> transactions. >>>> at >>>> org.apache.openjpa.persistence.EntityManagerImpl.getTransaction(Entity= ManagerImpl.java:360) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.initializeJPA(IMSSystemBean= .java:1102) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.startup(IMSSystemBean.java:= 1061) >>>> at >>>> org.objectweb.jonas_gen.com.lbslogics.ims.system.interfaces.JOnASIMSSy= stemBean2005147373Remote.startup(JOnASIMSSystemBean2005147373Remote.java:23 >>>> =20 >>> 4) >>> >>> It looks like IMSSystemBean.initializeJPA() is trying to invoked >>> EntityManager.getTransaction(). Since you're using JTA, you're not >>> allowed >>> to use getTransaction(); all transaction management must happen through >>> container-managed transactions or bean-managed transaction code. >>> >>> -Patrick >>> >>> --=20 >>> Patrick Linskey >>> BEA Systems, Inc.=20 >>> >>> _______________________________________________________________________ >>> Notice: This email message, together with any attachments, may contain >>> information of BEA Systems, Inc., its subsidiaries and affiliated >>> entities, that may be confidential, proprietary, copyrighted and/or >>> legally privileged, and is intended solely for the use of the individua= l >>> or entity named in this message. If you are not the intended recipient, >>> and have received this message in error, please immediately return this >>> by email and then delete it.=20 >>> >>> =20 >>>> -----Original Message----- >>>> From: Hans J. Prueller [mailto:hans.prueller@gmx.net]=20 >>>> Sent: Monday, February 05, 2007 12:54 PM >>>> To: open-jpa-dev@incubator.apache.org >>>> Subject: AW: Using OpenJPA within an "old" J2EE1.4 container=20 >>>> with managed transactions? >>>> >>>> =20 >>>>>> If that doesn't work, can you post the complete stack trace? >>>>>> =20 >>>> Thank you for your help. Unfortunately it did NOT work. I'm=20 >>>> not sure what >>>> the exact problem is, here are the strack-traces: >>>> >>>> first case:=20 >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> openjpa.ManagedRuntime: >>>> jndi(TransactionManagerName=3Djava:comp/UserTransaction) >>>> >>>> 2007-02-05 21:33:32,109 : IMSSystemBean.initializeJPA :=20 >>>> initializing JPA >>>> persist >>>> ence. >>>> 2007-02-05 21:33:33,796 : IMSSystemBean.initializeJPA : testing JPA >>>> persistence >>>> 156 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.Runtime - Starting >>>> OpenJ >>>> PA 0.9.6-incubating >>>> 359 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.jdbc.JDBC - OpenJPA >>>> will >>>> now connect to the database to attempt to determine what=20 >>>> type of database >>>> dicti >>>> onary to use. To prevent this connection in the future, set your >>>> openjpa.jdbc.D >>>> BDictionary configuration property to the appropriate value for your >>>> database (s >>>> ee the documentation for available values). >>>> 469 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.jdbc.JDBC - Using >>>> dictio >>>> nary class "org.apache.openjpa.jdbc.sql.MySQLDictionary" (MySQL >>>> 5.0.27-community >>>> -nt ,MySQL-AB JDBC Driver mysql-connector-java-5.0.4 ( $Date:=20 >>>> 2006-10-19 >>>> 17:47:4 >>>> 8 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )). >>>> 812 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.MetaData - Found 1 >>>> class >>>> es with metadata in 15 milliseconds. >>>> 844 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.MetaData - Found 1 >>>> class >>>> es with metadata in 0 milliseconds. >>>> 1094 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.MetaData - Parsing >>>> clas >>>> s "com.lbslogics.ims.util.JPATestObject". >>>> 1094 INFO [RMI TCP Connection(7)-192.168.0.6]=20 >>>> openjpa.MetaData - Parsing >>>> pack >>>> age "com.lbslogics.ims.util.JPATestObject". >>>> 1359 INFO [RMI TCP Connection(7)-192.168.0.6] openjpa.jdbc.Schema - >>>> Reading t >>>> able information for schema name "null", table name "JPATestObject". >>>> 1437 INFO [RMI TCP Connection(7)-192.168.0.6] openjpa.jdbc.Schema - >>>> Reading s >>>> equence information for schema "null", sequence name "null". >>>> <4|false|0.9.6-incubating> >>>> org.apache.openjpa.persistence.InvalidStateException: >>>> You cannot access the EntityTransaction when using managed=20 >>>> transactions. >>>> at >>>> org.apache.openjpa.persistence.EntityManagerImpl.getTransaction(Entit >>>> yManagerImpl.java:360) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.initializeJPA(IMSSystemBea >>>> n.java:1102) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.startup(IMSSystemBean.java >>>> :1061) >>>> at >>>> org.objectweb.jonas_gen.com.lbslogics.ims.system.interfaces.JOnASIMSS >>>> ystemBean2005147373Remote.startup(JOnASIMSSystemBean2005147373 >>>> Remote.java:23 >>>> 4) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>> java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >>>> sorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:585) >>>> at >>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) >>>> at >>>> org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnica >>>> stServerRef.java:143) >>>> at sun.rmi.transport.Transport$1.run(Transport.java:153) >>>> at java.security.AccessController.doPrivileged(Native Method) >>>> at sun.rmi.transport.Transport.serviceCall(Transport.java:149) >>>> at >>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 >>>> 66) >>>> at >>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport >>>> .java:707) >>>> at java.lang.Thread.run(Thread.java:595) >>>> 2007-02-05 21:33:35,187 : IMSSystemBean.startup : ERROR while=20 >>>> initializing >>>> JPA: >>>> You cannot access the EntityTransaction when using managed=20 >>>> transactions. >>>> >>>> >>>> second case:=20 >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> openjpa.ManagedRuntime: jndi(TransactionManagerName=3D/UserTransaction= ) >>>> >>>> <0|false|0.9.6-incubating> >>>> org.apache.openjpa.persistence.PersistenceException: >>>> /UserTransaction >>>> at >>>> org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransa >>>> ction(AbstractBrokerFactory.java:633) >>>> at >>>> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:292) >>>> at >>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBro >>>> kerFactory.java:165) >>>> at >>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(Delegatin >>>> gBrokerFactory.java:139) >>>> at >>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM >>>> anager(EntityManagerFactoryImpl.java:187) >>>> at >>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM >>>> anager(EntityManagerFactoryImpl.java:140) >>>> at >>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM >>>> anager(EntityManagerFactoryImpl.java:52) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.initializeJPA(IMSSystemBea >>>> n.java:1099) >>>> at >>>> com.lbslogics.ims.system.ejb.IMSSystemBean.startup(IMSSystemBean.java >>>> :1061) >>>> at >>>> org.objectweb.jonas_gen.com.lbslogics.ims.system.interfaces.JOnASIMSS >>>> ystemBean2005147373Remote.startup(JOnASIMSSystemBean2005147373 >>>> Remote.java:23 >>>> 4) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>> java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >>>> sorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:585) >>>> at >>>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) >>>> at >>>> org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnica >>>> stServerRef.java:143) >>>> at sun.rmi.transport.Transport$1.run(Transport.java:153) >>>> at java.security.AccessController.doPrivileged(Native Method) >>>> at sun.rmi.transport.Transport.serviceCall(Transport.java:149) >>>> at >>>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4 >>>> 66) >>>> at >>>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport >>>> .java:707) >>>> at java.lang.Thread.run(Thread.java:595) >>>> Caused by: javax.naming.NameNotFoundException: /UserTransaction >>>> at >>>> com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java >>>> :95) >>>> at javax.naming.InitialContext.lookup(InitialContext.java:355) >>>> at >>>> org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:140) >>>> at >>>> org.objectweb.carol.jndi.spi.AbsContext.lookup(AbsContext.java:150) >>>> at javax.naming.InitialContext.lookup(InitialContext.java:351) >>>> at >>>> org.objectweb.carol.jndi.spi.MultiContext.lookup(MultiContext.java:11 >>>> 8) >>>> at javax.naming.InitialContext.lookup(InitialContext.java:351) >>>> at >>>> org.apache.openjpa.ee.JNDIManagedRuntime.getTransactionManager(JNDIMa >>>> nagedRuntime.java:51) >>>> at >>>> org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransa >>>> ction(AbstractBrokerFactory.java:598) >>>> ... 21 more >>>> 2007-02-05 21:44:10,921 : IMSSystemBean.startup : ERROR while=20 >>>> initializing >>>> JPA: >>>> /UserTransaction >>>> >>>> ************************************************* >>>> >>>> >>>> From my understanding it seems that there is a fatal error in=20 >>>> the second=20 >>>> case, like openJPA was not able to even lookup JOnAS'=20 >>>> transaction manager. >>>> It seems to me that in the first case, the transaction=20 >>>> manager lookup worked >>>> but there is another subsequent error?=20 >>>> >>>> <4|false|0.9.6-incubating> >>>> org.apache.openjpa.persistence.InvalidStateException: >>>> You cannot access the EntityTransaction when using managed=20 >>>> transactions. >>>> at >>>> org.apache.openjpa.persistence.EntityManagerImpl.getTransaction(Entit >>>> yManagerImpl.java:360) >>>> >>>> Can you explain what this message means exactly? >>>> >>>> thank you in advance, >>>> HANS >>>> >>>> >>>> =20 >>>>> -----Urspr=C3=BCngliche Nachricht----- >>>>> Von: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com]=20 >>>>> =20 >>>> Im Auftrag von >>>> =20 >>>>> Marc Prud'hommeaux >>>>> Gesendet: Montag, 05. Februar 2007 21:19 >>>>> An: open-jpa-dev@incubator.apache.org >>>>> Betreff: Re: Using OpenJPA within an "old" J2EE1.4=20 >>>>> =20 >>>> container with managed >>>> =20 >>>>> transactions? >>>>> >>>>> Hans- >>>>> >>>>> We might not have Jonas' TransactionManager location configured in >>>>> the automatic TM lookup in OpenJPA. Can you try to manually specify >>>>> it with the following property: >>>>> >>>>> openjpa.ManagedRuntime: jndi(TransactionManagerName=3Djava:comp/ >>>>> UserTransaction) >>>>> >>>>> if that doesn't work, try: >>>>> >>>>> openjpa.ManagedRuntime: jndi(TransactionManagerName=3D/ >>>>> UserTransaction) >>>>> >>>>> (apparently, Jonas' UserTransaction implementation is also their >>>>> TransactionManager implementation) >>>>> >>>>> If that doesn't work, can you post the complete stack trace? >>>>> >>>>> If it does work, please let us know so we can add it to the list of >>>>> auto-discovered transaction managers. >>>>> >>>>> >>>>> >>>>> On Feb 5, 2007, at 12:05 PM, Hans J. Prueller wrote: >>>>> >>>>> =20 >>>>>> Hi there, >>>>>> >>>>>> >>>>>> >>>>>> I'm trying to migrate our "old" J2EE1.4 / EJB2.1 applications >>>>>> persistence to >>>>>> openJPA. Currently I got stuck when >>>>>> >>>>>> trying to configure OpenJPA persistence, when creating the >>>>>> EntityManagerFactory and the EntityManager instance, >>>>>> >>>>>> I get the following error: >>>>>> >>>>>> >>>>>> >>>>>> <4|true|0.9.6-incubating> >>>>>> org.apache.openjpa.persistence.InvalidStateException: >>>>>> >>>>>> Could not perform automatic lookup of EJB container's >>>>>> javax.transaction.Transact >>>>>> >>>>>> ionManager implementation. Please ensure that you are running the >>>>>> application fr >>>>>> >>>>>> om within an EJB 1.1 compliant EJB container, and then set the >>>>>> org.apache.openjp >>>>>> >>>>>> a.ManagedRuntime property to the appropriate value to obtain the >>>>>> TransactionMana >>>>>> >>>>>> ger. >>>>>> >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(A >>>> =20 >>>>>> utomaticManagedRuntime.java:180) >>>>>> >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransa >>>> =20 >>>>>> ction(AbstractBrokerFactory.java:598) >>>>>> >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:292) >>>> =20 >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBro >>>> =20 >>>>>> kerFactory.java:165) >>>>>> >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(Delegatin >>>> =20 >>>>>> gBrokerFactory.java:139) >>>>>> >>>>>> at >>>>>> >>>>>> =20 >>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM >>>> =20 >>>>>> anager(EntityManagerFactoryImpl.java:187) >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Currently I'm running the application within the JOnAS 4.8.3 J2EE >>>>>> Server. >>>>>> How can I configure open JPA to >>>>>> >>>>>> use the provided managed Transactions of JOnAS? (this=20 >>>>>> =20 >>>> works also with >>>> =20 >>>>>> Hibernate 2.x so I assume it should >>>>>> >>>>>> somehow be possible with openJPA?) >>>>>> >>>>>> >>>>>> >>>>>> any help appreciated! >>>>>> >>>>>> >>>>>> >>>>>> regards, >>>>>> >>>>>> HANS >>>>>> >>>>>> >>>>>> >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>>> virtually hanzz... >>>>>> >>>>>> >>>>>> >>>>>> http://hanzz.zapto.org (personal) >>>>>> http://www.cse.dmu.ac.uk/~hansp >>>>>> (research) >>>>>> >>>>>> >>>>>> >>>>>> =20 >>>> =20 >>> =20 >> >> =20 >=20 >=20 --=20 View this message in context: http://www.nabble.com/Using-OpenJPA-within-an= -%22old%22-J2EE1.4-container-with-managed-transactions--tf3176559.html#a113= 41475 Sent from the OpenJPA Developers mailing list archive at Nabble.com.