Java Hibernate/C3P0 error: “Could not obtain connection metadata. An attempt by a client to checkout a Connection has timed out.”

前端 未结 3 2166
星月不相逢
星月不相逢 2021-02-19 11:24

I\'m trying to get some code I was passed up and running. It appears to use the Hibernate framework. I\'ve gotten past most of the errors tweaking the configuration, but this on

3条回答
  •  忘了有多久
    2021-02-19 11:42

    If you have set C3P0's "checkoutTimeout" property to something other than 0 you might be timing out too quickly (that was my problem, solution: bumped it to 2000 milliseconds from 500).

    Alternatively, there's a workaround for this warning:

    Set the hibernate.temp.use_jdbc_metadata_defaults property to false.

    Found this in http://www.docjar.com/html/api/org/hibernate/cfg/SettingsFactory.java.html, though there may be side effects of not having Hibernate extract JDBC Metadata defaults.

提交回复
热议问题