Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
Last active October 23, 2015 14:10
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 rafaeltuelho/fb7fc0d372a0cf85a53e to your computer and use it in GitHub Desktop.
Save rafaeltuelho/fb7fc0d372a0cf85a53e to your computer and use it in GitHub Desktop.
Persistence unit JPA 2.0 witn resource local (non-jta-datasource) sample XML
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unit3" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- non-jta-datasource>jdbc/arquillian</non-jta-datasource -->
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="false"/>
<property name="hibernate.generate_statistics" value="true"/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"/>
<!-- property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost/~/var/h2db/test"/ -->
<property name="javax.persistence.jdbc.user" value="JBTRAVEL_USER"/>
<property name="javax.persistence.jdbc.password" value="jbtravel"/>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
</properties>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment