tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: OpenEJB - Missing required persistence.xml
Date Fri, 15 Feb 2008 22:37:42 GMT

On Feb 15, 2008, at 4:03 AM, <Karsten.Ohme@t-systems.com> <Karsten.Ohme@t-systems.com

 > wrote:

> Not working, the tables are not created. Now I get this:
>
> Auto-commit can not be set while enrolled in a transaction
>

I'm very interested in how you got this error so I can fix any related  
checks we have.  In 3.0-beta-2 I attempted to make it impossible to  
get this error -- apparently unsuccessfully :)

Info that will help:
  - the persistence.xml
  - let me know if you're using PersistenceContextType.TRANSACTION  
(default) or PersistenceContextType.EXTENDED in your  
@PersistenceContext annotation
  - the openejb log output so I can see what kind of configuration  
ended up getting used.
  - your test setup code


The "Auto-commit" error usually means is that either a) only the jta- 
data-source is configured in your persistence.xml so OpenJPA  
incorrectly attempts to use it also as an non-jta-data-source, or b)  
the non-jta-data-source specified is actually a jta-data-source (i.e.  
a Resource where the 'JtaManaged' property isn't set to 'false')

In 3.0-beta-2 it's impossible to set jta-data-source to a  
JtaManaged=false Resource or to set the non-jta-data-source to a  
JtaManaged=true Resource.  Also, if you don't supply either jta-data- 
source or non-jta-data-source, we will create Resources for you with  
their JtaManaged property set accordingly, and set them as the value  
of jta-data-source or non-jta-data-source, so it's also impossible to  
not have them filled in as we will fill them in when you haven't.  The  
thing I've noticed in the code now is that our "make a managed/ 
unmanaged datasource for you" code could be smarter and needs to be  
improved -- it should take the one you defined (if there is one), copy  
it, set the JtaManaged flag accordingly, then use that.

As an FYI, I've been taking all these exchanges and using them to help  
fill out the docs:

   http://cwiki.apache.org/OPENEJBx30/jpa-usage.html
   http://cwiki.apache.org/OPENEJBx30/openjpa.html

I have an empty Hibernate doc waiting in the wing:

   http://cwiki.apache.org/OPENEJBx30/hibernate.html

-David


Mime
View raw message