Java Hibernate persistence.xml:禁用上下文LOB创建,因为连接为null
MyJava Hibernate persistence.xml:禁用上下文LOB创建,因为连接为null,java,xml,hibernate,jpa,persistence.xml,Java,Xml,Hibernate,Jpa,Persistence.xml,Mypersistence.xml: <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" xmlns="http://java.sun.c
persistence.xml
:
<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" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.ibm.apiscanner.DTO.BaselineDTO</class>
<properties>
<property name="hibernate.connection.driver_class" value="com.ibm.db2.jcc.DB2Driver" />
<property name="hibernate.connection.url" value="jdbc:db2://localhost:{PORT}/{DB}" />
<property name="hibernate.connection.username" value="{user}" />
<property name="hibernate.connection.password" value="{password}" />
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
<property name="show_sql" value="true"/>
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
</properties>
</persistence-unit>
</persistence>
org.hibernate.jpa.HibernatePersistenceProvider
com.ibm.apiscanner.DTO.BaselineDTO
我收到了以下文件:
Jan 22, 2015 9:16:48 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.DB2Dialect
Jan 22, 2015 9:16:48 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000422: Disabling contextual LOB creation as connection was null
2015年1月22日9:16:48 PM org.hibernate.dialogue.dialogue
信息:HH000400:使用方言:org.hibernate.dial.DB2Dialect
2015年1月22日晚上9:16:48 org.hibernate.engine.jdbc.internal.LobCreatorBuilder UseContexturationAllobCreation
信息:HH000422:由于连接为空,因此禁用上下文LOB创建
当通过基本JDBC连接时,相同的url、用户和密码组合也可以工作 有人有建议吗?这是一条信息消息(无需担心),因为您设置了:
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
但是你会得到一些其他信息,告诉你:
HHH000421: Disabling contextual LOB creation as hibernate.jdbc.lob.non_contextual_creation is true
对我来说,这是一个驱动程序版本问题 -让您拥有db2jcc4.jar,并且它与早期版本没有冲突
-确保您已指定currentschema我删除了该属性,没有任何更改。如何检查连接是否良好
.persist()
似乎不起作用。可能是连接不起作用。只需使用您的DB客户端并尝试连接到相同的URL/user/password。通过基本JDBCN连接时,相同的URL、用户和密码组合可以工作。这就是Hibernate 4.3.7的表现。我没有其他线索。在这种情况下,您需要添加调试。4.3.7?我的jar版本是4.3.5,这会有什么不同吗?“对我来说,原因很明显:连接是空的,因为数据库没有响应。”我补充了这一点作为答案,但它不适合某些人,因此被否决。如果像我这样的人用相同的符号学来回答这个问题,我把这些信息留在这里是为了完整。
HHH000421: Disabling contextual LOB creation as hibernate.jdbc.lob.non_contextual_creation is true