This is my persistence.xml file:
<persistence 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/ ... ce_1_0.xsd"
version="1.0">
<persistence-unit name="dvdstorePU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.archive.autodetection"
value="class, hbm" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.driver_class"
value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url"
value="jdbc:mysql://localhost:3306/dvdstore" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password"
value="system" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
I've changed the ejb-jar.xml: I use Bean because I use BMT inside the ejb session code.
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
In the ejb session bean:
Actor actor = new Actor();
actor.setFirstname(firstname);
actor.setName(name);
EntityManagerFactory emf = Persistence.createEntityManagerFactory("dvdstorePU");
EntityManager em = emf.createEntityManager();
UserTransaction tx = (UserTransaction) new InitialContext().lookup("UserTransaction");
tx.begin();
em.persist(actor);
tx.commit();
em.close();
Thanks for any help which could solve my problem: my POJO class is not stored in the database, and I have no exception.