Hibernate Communications Link Failure in Hibernate Based Java Servlet application powered by MySQL

后端 未结 4 1215
别那么骄傲
别那么骄傲 2021-01-02 16:33

Let me describe my question -

I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my applic

4条回答
  •  攒了一身酷
    2021-01-02 17:10

    I solved my communication link failure with c3p0. I came across the blog below that explained that the org.hibernate version must be equal to the c3p0 version, so this is the pom configuration that made my day

    
                org.hibernate
                hibernate-core
                4.3.6.Final
    
    
        org.hibernate
         hibernate-entitymanager
         4.3.1.Final
     
    
     org.hibernate
      hibernate-c3p0
     4.3.6.Final
    
    
      
        c3p0
        c3p0
       0.9.1.2
    
    

    like he explains, it was enough to add only one property to hibernate.cfg.xml to get c3p0 pooling

           10
    

    no more "communication link error" , "expected to read 5 bytes,read 0" after that. here is the link:https://howtodoinjava.com/hibernate/hibernate-c3p0-connection-pool-configuration-tutorial/

提交回复
热议问题