Skip to content

Instantly share code, notes, and snippets.

@kevinhooke
Created April 14, 2015 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinhooke/5daf864a0f9a58bd2c96 to your computer and use it in GitHub Desktop.
Save kevinhooke/5daf864a0f9a58bd2c96 to your computer and use it in GitHub Desktop.
JPA persistence.xml with JTA and Weblogic transaction manager
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="SimplePU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/datasourcename</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create" /> <!-- remove this if not creating tables at init -->
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment