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

Hibernate Java Discussion :

Conflit du pool Hibernate avec Mysql?


Sujet :

Hibernate Java

  1. #1
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut Conflit du pool Hibernate avec Mysql?
    Salut tout le monde.
    J'aimerais savoir s'il existe un conflit entre le pool de connexion d'Hibernate avec Mysql.
    J'ai une application web sous mysql et j'utilise hibernate pour la gestion de la connexion.mais aprés des heures d'utilisation de l'applications j'ai une exception lors de la connexion :
    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
     
    org.hibernate.exception.GenericJDBCException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
    	at big.commun.data.BigObjet.getSession(BigObjet.java:1808)
    	at big.commun.auth.BigAuth.getSession(BigAuth.java:69)
    	at big.commun.auth.BigAuth.SelectUser(BigAuth.java:159)
    	at big.commun.auth.BigAuthAction.processRequest(BigAuthAction.java:46)
    	at auth.AuthAction.processRequest(AuthAction.java:22)
    	at big.commun.data.BigActionServer.doPost(BigActionServer.java:251)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException
    	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
    	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531)
    	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    	at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
    	... 24 more
    Caused by: java.lang.InterruptedException
    	at java.lang.Object.wait(Native Method)
    	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1315)
    	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
    	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
    	... 27 more
    Quelle pourrait être la raison de cette erreur?

    Cordialement.

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Et après l'exception, vous arrivez de nouveau à créer des session hibernate?

    Il peux y avoir des tas de raison à un InterruptedException, mal heureusement, car c'est le mécanisme utilisé pour demander à un Thread d'arrêter son travail en cours

    Il n'y a pas d'erreur dans les logs de mysql? Pas d'autre message avant? Vous fermez bien vos sessions?

  3. #3
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Pour pouvoir se reconnecter à l'application on doit recharger l'application (avec la manager de TOMCAT).
    Coté logs Mysql je n'ai rien trouvé.
    Pour les sessions nous ouvrons et fermons les sessions pour chaque transaction.
    Pour être que mon fichier de configuration hibernate sera utile:
    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
     
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
              "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
              "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
     
    <!-- Generated by MyEclipse Hibernate Tools.                   -->
    <hibernate-configuration>
    <session-factory>
    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="show_sql">true</property>
    <property name="max_fetch_depth">3</property>
    <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    <property name="c3p0.acquire_increment">2</property>
    <property name="c3p0.idle_test_period">3000</property>
    <property name="c3p0.timeout">1800</property>
    <property name="c3p0.max_size">25</property>
    <property name="c3p0.min_size" >3</property>
    <property name="c3p0.max_statement">0</property>
    <property name="c3p0.preferredTestQuery">select 1;</property>
    <property name="c3p0.validate">true</property>
    <property name="myeclipse.connection.profile">MysqlS2</property>
    </session-factory>
    </hibernate-configuration>

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Si vous êtes dans une conteneur tomcat, préférez la désactivation de C3P0 et utilisez le datasource du conteneur pour requerir les donnée depuis jdbc. Le conteneur fournis lui même la structure nécessaire pour faire le pooling.

  5. #5
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Si vous pensez que ceci est en relation avec le problème alors je demande plus d'explications si c'est possible.

  6. #6
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    je ne pense pas que ça puisse avoir un lien, mais hibernate , de mémoire, ne recommande pas d'utiliser leur pool interne, mais plutot d'utiliser une datasource

  7. #7
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Sur le Faq du site il est recommandé d'utiliser C3P0 à la place de celui utilisé par Hibernate,et c'est ce qu'on a fait.

  8. #8
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Pas d'autres pistes pour le problème signaler??

  9. #9
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Le plus probable pour moi est un problème au niveau de la connexion DB (d'ou la recherche dans les logs).

    Si vous avez un doutes sur le pool de connexion C3P0, comme suggéré, utilisez la datasource et le pooling de votre conteneur (ici tomcat).

    A moins que l'erreur continue systématiquement après la première erreur, il n'y a pas de raison pour avoir besoin de redémarrer. Nouvelle session hibernate = nouvelle connexion = normalement pas de soucis.

  10. #10
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Je ne trouve vraiment pas le problème qui deviens vraiment pausent,à chaque fois je dois recharger l'application.Quelqu'un pourrait me donner des explications sur le rechargement d'une application et ce qui se passe, et aussi sur la gestion d'un pool de connexion.
    Cordialement.

  11. #11
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Je suis arrivé à détaillé encore plus l'exception:
    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
     
    org.hibernate.exception.GenericJDBCException: Cannot open connection
    	at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
    	at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
    	at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
    	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
    	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
    	at big.commun.data.BigObjet.getSession(BigObjet.java:1826)
    	at big.commun.auth.BigAuth.getSession(BigAuth.java:68)
    	at big.commun.auth.BigAuth.SelectUserPermission(BigAuth.java:142)
    	at big.commun.auth.BigAuthAction.processRequest(BigAuthAction.java:58)
    	at auth.AuthAction.processRequest(AuthAction.java:22)
    	at big.commun.data.BigActionServer.doPost(BigActionServer.java:251)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
    	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
    	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    	at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
    	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
    	... 24 more
    Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
    	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
    	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
    	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)

    donc la raison c'est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    Quel explication donner dans ce cas.

  12. #12
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    y a vraiment aucune trace d'un message qui viedrais du driver jdbc? La on a juste C3PO qui dit qu'il n'a pas pu établir une connexion

  13. #13
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Je me demande plutôt si le problème n'es pas lié à Mysql qui ferme toutes les connexions après 8h d'inactivité

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

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 957
    Points : 4 386
    Points
    4 386
    Par défaut
    Citation Envoyé par SaladinDev Voir le message
    Je me demande plutôt si le problème n'es pas lié à Mysql qui ferme toutes les connexions après 8h d'inactivité
    Entre autres… et aussi si vous activez au moins le niveau INFO des logs :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    INFO [org.hibernate.connection.DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
    ce qui est assez clair comme avertissement…

  15. #15
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Citation Envoyé par JeitEmgie Voir le message
    Entre autres… et aussi si vous activez au moins le niveau INFO des logs :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    INFO [org.hibernate.connection.DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
    ce qui est assez clair comme avertissement…
    Si le problème est lié à Mysql comment remédie à ce problème.
    J'aimerai aussi plus de détaille sur la 2eme remarque et la gestion des logs.

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

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 957
    Points : 4 386
    Points
    4 386
    Par défaut
    Citation Envoyé par SaladinDev Voir le message
    Si le problème est lié à Mysql comment remédie à ce problème.
    J'aimerai aussi plus de détaille sur la 2eme remarque et la gestion des logs.
    Hibernate lui-même vous prévient que son pool interne de connections n'est pas conçu pour un usage professionnel…
    et cela quand vous activez le niveau INFO au moins du logging sur le framework Hibernate.

  17. #17
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    Mais j'utilise c3p0 pour la gestion du pool de connexion

  18. #18
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Je connais pas C3P0, mais si mysql ferme la connexion au bout de 8h, il faut le détecter. La pluspart des pool offrent une possibilité de "valider" les connexion avant de les retourner à l'appelant. Si la connexion est invalide elle est fermée et remplacée par une neuve.

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

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 957
    Points : 4 386
    Points
    4 386
    Par défaut
    Citation Envoyé par SaladinDev Voir le message
    Mais j'utilise c3p0 pour la gestion du pool de connexion
    oops… lu trop vite… le titre m'induit en erreur…

    avec Spring et le pool de connection en bean, on peut spécifier destroy-method="close", ce qui en général est une partie de la solution à ce problème, comment le faire dans votre configuration est une autre question…

    Et vous avez aussi le paramètre c3p0.idleConnectionTestPeriod (hibernate.c3p0.idle_test_period).

    (voir http://www.mchange.com/projects/c3p0...ection_testing)

  20. #20
    Membre du Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2004
    Messages
    92
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Octobre 2004
    Messages : 92
    Points : 58
    Points
    58
    Par défaut
    J'ai essaye la balise :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <property name="c3p0.idle_test_period">3000</property>
    mais ça donne rien,vraiment je n'arrive pas à comprendre le problème.

Discussions similaires

  1. Hibernate avec Mysql
    Par dark_meteor dans le forum Hibernate
    Réponses: 5
    Dernier message: 11/05/2010, 01h26
  2. fichier Mapping hibernate avec MySQL
    Par benamira dans le forum Hibernate
    Réponses: 2
    Dernier message: 17/01/2009, 05h11
  3. Problème cache hibernate avec MySQL
    Par bierfoot dans le forum Hibernate
    Réponses: 0
    Dernier message: 14/01/2009, 14h51
  4. essai "debuter avec hibernate" avec MYSQL et j'y arrive pas
    Par alligator424 dans le forum Hibernate
    Réponses: 5
    Dernier message: 08/08/2007, 14h02
  5. [pool de connexion] avec mysql et eclipse
    Par Mascotte dans le forum Servlets/JSP
    Réponses: 16
    Dernier message: 15/02/2007, 15h02

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