Bonjour,

Je commence un projet JPA/Hibernate de 0.

J'ai un problème, je pense avec mon persistance.xml

A chaque fois que mon DAO, tente de faire une requête , j'ai une erreur la factory est fermée ou pas de tx...

Je ne sais pas où je me suis trompé.

Si vous avez une idée ?
Merci d'avance car je tourne en rond

Cordialement

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<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/persistence_2_0.xsd" 
 version="2.0">
 
 <persistence-unit name="xcompta" transaction-type="JTA">
 
         <!-- <jar-file>MyOrderApp.jar</jar-file> -->
        <!-- <class>fr.xcompta.base.Journal</class> -->
 
 <properties> 
 <property name="hibernate.archive.autodetection" value="class" /> 
  <property name="hibernate.show_sql" value="true" />
 <property name="hibernate.format_sql" value="true"/>
 
 <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> 
 <property name="javax.persistence.jdbc.url" value="	jdbc:mysql://localhost/xcompta" /> 
 <property name="javax.persistence.jdbc.user" value="xcompta" /> 
 <property name="javax.persistence.jdbc.password" value="xcompta" /> 
 
 <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> 
 
 <property name="hibernate.hbm2ddl.auto" value="create" />
 
 
 </properties> 
 
 </persistence-unit> 
</persistence>