How to configure JTA and Non -JTA datasource in persistence.xml in EAP 6

Solution Unverified - Updated -

Issue

  • Configured persistence.xml with this datasource:
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/testDB</jta-data-source>

But in the standalone.xml don't have this datasource name at all.
Expected to see an error when using the DAO but ni fact, when trying to access the DAO class The server hangs on without any error.
Is this a bug? Why there is no exception?
in the DAO have this configuration:

@PersistenceContext(unitName = "testUnit")
    EntityManager _em;
  • In persistence.xmlusing oracle or sql server , depends on the customer noticed that there is no need to declare this anymore:
<!--            <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /> -->

It seems that hibernate identify the database type automatically.
1. Is this the case?
2. should it use JPA properties in order to define driver and dialect? for example:

"javax.persistence.jdbc.driver"
  • When should use this property?
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver" />

Noticed that by adding this property, no matter what is the value, JBoss/Hibernate ignore it. also, It seems that hibernate ignore this property too:

<property name="javax.persistence.schema-generation.scripts. value="drop-and-create" />

And only care about it's proprietary property

<property name="hibernate.hbm2ddl.auto" value="create-drop"/>

Can help to understand?
Is it possible to configure only JPA standard properties?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content