Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » eclipselink.ddl-generation and JTA datasources
eclipselink.ddl-generation and JTA datasources [message #987351] Mon, 26 November 2012 09:19 Go to next message
Jorg Heymans is currently offline Jorg HeymansFriend
Messages: 26
Registered: July 2009
Location: Belgium
Junior Member
Hi,

DDL generation does not work on JTA datasources, so i am wondering how people in general tackle this in their continuous integration environment ? In CI we have the server configured mostly like a production server, with fully configured JTA/XA resources but that means that Eclipselink cannot automatically create the database tables.

What would be needed is EclipseLink to be able to use a non-jta datasource during database creation, and use the 'normal' jta datasource during the runtime of the application. Is there any hack or workaround that would facilitate this ?

Thanks
Jorg
Re: eclipselink.ddl-generation and JTA datasources [message #987363 is a reply to message #987351] Mon, 26 November 2012 10:01 Go to previous messageGo to next message
Jorg Heymans is currently offline Jorg HeymansFriend
Messages: 26
Registered: July 2009
Location: Belgium
Junior Member
one possible solution is just thought of is to during the build generate the ddl from ant script reusing the eclipselink DDL generation classes.

To be seen if Eclipselink is that flexible, can it just be called from the command line to generate DDL for a project ?
Re: eclipselink.ddl-generation and JTA datasources [message #987691 is a reply to message #987363] Tue, 27 November 2012 15:57 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

DDL generation does work with JTA datasources. What JavaEE server and database are you using?

You can also define a non-jta-datasource in your persistence.xml if your datasource has issues, (in addition to the jta one).


James : Wiki : Book : Blog : Twitter
Re: eclipselink.ddl-generation and JTA datasources [message #987782 is a reply to message #987691] Wed, 28 November 2012 07:32 Go to previous messageGo to next message
Jorg Heymans is currently offline Jorg HeymansFriend
Messages: 26
Registered: July 2009
Location: Belgium
Junior Member
Hi James,

According to this link it doesn't http://docs.oracle.com/cd/A91202_01/901_doc/java.901/a90188/trans.htm#1271171 and it's also my experience with other tools or libraries that attempt to create their tables automatically over a jta datasource.

We're using weblogic 10.3.4 with oracle 11g. The only way i could get it to work was to setup my application datasource as a non-xa datasource supporting global transactions using LLR optimization. It's kind of a hack but it works.

If you are saying that DDL works over a JTA datasource can you post more specific details ? Our application is Spring based, we don't use persistence.xml but handle everything through LocalEntityManagerFactoryBean and PersistenceUnitPostProcessor.


THanks !
Re: eclipselink.ddl-generation and JTA datasources [message #989095 is a reply to message #987782] Tue, 04 December 2012 15:25 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

All of our tests generate DDL using JTA data sources on multiple different JavaEE servers, and I have not seen any issues with this.

Perhaps you have multiple different databases registered for the same JTA transaction when the DDL is being generated? The database XA may not allow this.

You could also try,

"eclipselink.deploy-on-startup"="true"

This will cause the DDL to be generated at startup, when hopefully there is no active JTA transaction.


James : Wiki : Book : Blog : Twitter
Re: eclipselink.ddl-generation and JTA datasources [message #989955 is a reply to message #989095] Mon, 10 December 2012 09:05 Go to previous message
Jorg Heymans is currently offline Jorg HeymansFriend
Messages: 26
Registered: July 2009
Location: Belgium
Junior Member
That's helpful thanks James. I have to adjust my wording then: "DDL statements do work over an XA datasource, but not when that datasource is participating in a JTA transaction". For our case putting the deploy-on-startup made it work.

Thanks
Previous Topic:Loging SQL to a file
Next Topic:xsd:Any, marshalling, and escaping
Goto Forum:
  


Current Time: Thu Apr 25 05:50:41 GMT 2024

Powered by FUDForum. Page generated in 0.03613 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top