IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JPA Java Discussion :

Relation unidirectionnel - ManyToOne


Sujet :

JPA Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    106
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Juin 2007
    Messages : 106
    Par défaut Relation unidirectionnel - ManyToOne
    Bonjour à tous,

    Je début à JPA et je me confronte à un premier problème :

    J'ai une classe Tool et une classe Category. Un Tool a 1 et 1 seule Category. Une Category a entre 0 et n Tools. J'aimerai faire une relation uni-directionnel pour que dans les tables générées un Tool contient un champ contenant l'id d'une Category.

    Mes classes Tool.java et Category.java :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    @Entity
    public class Tool implements Serializable {
        @Id
        @GeneratedValue
        private int id;
     
        @ManyToOne(cascade=CascadeType.ALL)
        @NotNull
        private Category category;
     
    // + constructeur prenant une category, et getters/setters classiques
    }
    La classe Category java est un simple pojo auquel j'ai rajouté les annotations classiques pour un EJB entity : @Entity, @Id et @GeneratedValue.

    Mon code de test :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    //[...]
    Category category = new Category();
    categories.add(category); // cette méthode contient un appel du type em.persist ....
    for(int i = 0 ; i < 10 ; i++)
        tools.add(new Tool(category)); // em.persist .....
    //[...]
    Mon problème :

    Au niveau des tables générées dans la base de données, tout est correct. Parcontre, le code de test me rajoute bien 10 nouveaux Tools dans la table. Le problème est qu'il m'a également rajouté 11 Category (les 10 de la boucle + la première), alors que je n'en voudrai qu'une seule.

    Je me doute bien que le problème vient du CascadeType, le problème est que si je l'enlève j'ai une runtime exception : not-null property references a null or transient value: com.alu.tms.entities.Tool.category) Et si en plus j'enlève le NotNull : Can't commit because the transaction is in aborted state

    Voilà... Quelqu'un pourrait t'il m'éclairer? Merci d'avance !

  2. #2
    Membre Expert
    Homme Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 963
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 963
    Par défaut
    Citation Envoyé par jsebfranck Voir le message
    Mon problème :

    Au niveau des tables générées dans la base de données, tout est correct. Parcontre, le code de test me rajoute bien 10 nouveaux Tools dans la table. Le problème est qu'il m'a également rajouté 11 Category (les 10 de la boucle + la première), alors que je n'en voudrai qu'une seule.

    Je me doute bien que le problème vient du CascadeType, le problème est que si je l'enlève j'ai une runtime exception : not-null property references a null or transient value: com.alu.tms.entities.Tool.category) Et si en plus j'enlève le NotNull : Can't commit because the transaction is in aborted state

    Voilà... Quelqu'un pourrait t'il m'éclairer? Merci d'avance !
    un simple test dans une UnitTest avec votre pattern :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    	public final void testOwnerOwnee() {
    		Owner owner = new Owner("a") ;
     
    		getContext().getRepository().persist(owner) ;
     
    		for(int i=0 ; i<3 ; i++) {
    			Ownee ownee = new Ownee(owner) ;
    			getContext().getRepository().persist(ownee) ;
    		}
     
    		setComplete() ;
    	}
    avec
    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
    31
    32
    33
    34
    35
    36
    37
     
    @Entity
    @Table(name="TEST_OWNER")
    public class Owner {
     
    	@Id
    	@GeneratedValue
    	protected long	id	 ;
     
    	@Column(name="name")
    	@Length(max=32)
    	protected String itsName ;
     
    	public Owner() {
     
    	}
     
    	public Owner(String inName) {
    		itsName = inName ;
    	}
     
    	public long getId() {
    		return id;
    	}
     
    	public void setId(long id) {
    		this.id = id;
    	}
     
    	public String getItsName() {
    		return itsName;
    	}
     
    	public void setItsName(String itsName) {
    		this.itsName = itsName;
    	}
    }
    et
    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
    31
    32
    33
    34
    35
    36
    37
     
    @Entity
    @Table(name="TEST_OWNEE")
    public class Ownee {
     
    	@Id
    	@GeneratedValue
    	protected long id ;
     
    	@ManyToOne(cascade=CascadeType.ALL)
    	protected Owner itsOwner ;
     
    	public Ownee() {
     
    	}
     
    	public Ownee(Owner inOwner) {
    		itsOwner = inOwner ;
    	}
     
    	public long getId() {
    		return id;
    	}
     
    	public void setId(long id) {
    		this.id = id;
    	}
     
    	public Owner getItsOwner() {
    		return itsOwner;
    	}
     
    	public void setItsOwner(Owner itsOwner) {
    		this.itsOwner = itsOwner;
    	}
     
    }
    donne comme résultat :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    select * from test_owner ;
       id    | name 
    ---------+------
     1169843 | a
    (1 row)
     
    select * from test_ownee ;
       id    | itsowner_id 
    ---------+-------------
     1169844 |     1169843
     1169845 |     1169843
     1169846 |     1169843
    (3 rows)
    donc on pourrait en conclure (en première approximation) que c'est le code de vos .add qui génère le problème…

    (ou éventuellement un overwrite boiteux de hashCode et equals de Category…)

    (notez aussi que le persist du Owner n'est pas nécessaire puisque le cascade se fait à partir du Ownee…, -> enlever le persist en dehors de la boucle donne le même résultat…)

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    106
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Juin 2007
    Messages : 106
    Par défaut
    Effectivement, je pense aussi que mon problème vient de mes méthodes add.

    Jusqu'à présent je n'utilisais pas de transaction, je les ai rajoutés à mon code mais à l'exécution j'obtiens l'erreur suivante :

    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
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.RollbackException: Error while commiting the transaction
    	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
    	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
    	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
    	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
    Caused by: javax.persistence.RollbackException: Error while commiting the transaction
    	at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
    	at com.alu.tms.sessions.SessionBean.add(SessionBean.java:38)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
    	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
    	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
    	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
    	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
    	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
    	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
    	at org.jboss.remoting.Client.invoke(Client.java:1550)
    	at org.jboss.remoting.Client.invoke(Client.java:530)
    	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
    	at $Proxy0.add(Unknown Source)
    	at test.TestCategory.main(TestCategory.java:28)
    	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
    	at $Proxy0.add(Unknown Source)
    	at test.TestCategory.main(TestCategory.java:28)
    Caused by: org.hibernate.TransactionException: JDBC commit failed
    	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
    	at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
    	at com.alu.tms.sessions.SessionBean.add(SessionBean.java:38)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
    	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
    	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
    	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
    	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
    	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
    Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
    	at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543)
    	at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
    	at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
    	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
    	... 35 more
    J'utilise une base de donnée mysql avec des moteurs de stockages innoDB, voici de plus mon fichier persistence.xml.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <persistence>
          <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
          <non-jta-data-source>java:/MySqlDS</non-jta-data-source> 
          <properties>
          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
          </properties>
          </persistence-unit>
    </persistence>
    Une autre idée pour me sortir de l'impasse?

  4. #4
    Membre expérimenté
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    156
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 156
    Par défaut
    Ton problème est assez bizzare.
    Dans ton fichier de persistence tu déclares la gestion des transaction en tant que RESOURCE_LOCAL, mais quand on regarde la pile d'exception, et surtout le mesage d'erreur tu as une erreur indiquant que les transactions sont managées.
    Il y a du code d'AOP de JBoss dans la pile d'exception. Peut on voir le code de ton main ?
    En attendant enlève de ton code la gestion explicite des transactions de ton code.

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    106
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Juin 2007
    Messages : 106
    Par défaut
    Voici une de mes fonctions d'ajout :
    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
     
            @Override
    	public void add(Category category) {
    		EntityManager em = entityManagerFactory.createEntityManager();
     
    		try {
    		   em.persist(category);
                       em.commit();
    		}
    		catch (RuntimeException e) {
    		   throw e;
    		}
    		finally {
    		   em.close();
    		} 
    	}
    A noter que si j'enlève toutes les transactions le code s'effectue mais rien n'est ajouté dans la base.

    Si j'enlève seulement le commit, l'ajout est effectué, MAIS si j'en fait plusieurs successivement ou si je lance le programme plusieurs fois de suite, au bout d'un moment ça plante parce qu' apparemment les ressources ne sont pas bien libérées...

    Une autre idée?

  6. #6
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    106
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Juin 2007
    Messages : 106
    Par défaut
    Complément d'information, si j'enlève les commit je les traces suivantes dans la console jboss :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    11:04:03,136 WARN  [WrappedConnection] Closing a result set you left open! Please close it yourself.
    java.lang.Throwable: STACKTRACE
    Comment pourrai je libérer ces ressources?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème : Relation OneToMany/ManyToOne bidirectionnelle
    Par KrisWall dans le forum Doctrine2
    Réponses: 1
    Dernier message: 09/09/2012, 08h46
  2. Réponses: 2
    Dernier message: 01/08/2012, 08h07
  3. Réponses: 1
    Dernier message: 24/04/2012, 14h51
  4. Réponses: 2
    Dernier message: 18/02/2010, 13h57
  5. Cascade et Relation Unidirectionnelle
    Par mehdi_31 dans le forum Hibernate
    Réponses: 7
    Dernier message: 26/08/2006, 16h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo