early I used JPA to developed ORM for my application. In peristenc.xml , I defined hibernate provider and using Non-JTA-DataSource. JPA can run without hibernate provider.??? then I omit hibernate code in persistence.xml. Then I deployed, In console I’m getting following information.
18:19:56,028 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-6) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
18:19:56,032 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-6) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
18:19:56,033 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-6) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactor
But I didn’t mention any where in my apps about hibernate.
** persistence.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="StudentManagementSystem" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:jboss/datasources/studentDS</non-jta-data-source>
<class>com.dms.entity.student.StudentDetail</class>
<class>com.dms.entity.student.MarkDetail</class>
<class>com.dms.entity.student.PRDSemesterDetail</class>
<class>com.dms.entity.admin.LoginDetail</class>
</persistence-unit>
</persistence>
* Non-JTA- data source *
<datasource jndi-name="java:jboss/datasources/studentDS" pool-name="studentDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/exercise</connection-url>
<driver>com.mysql</driver>
<security>
<user-name>student</user-name>
<password>student</password>
</security>
</datasource>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</xa-datasource-class>
</driver>
You’re running your application in JBoss, and Hibernate is the default persistence provider of JBoss. As stated in the spec, the persistence provider is optional in persistence.xml. In this case, the container (JBoss) uses its default provider.