[hibernate-issues] [JIRA] (HHH-8511) "Can't convert fromnull" when inserting clob in Informix

LAdO (JIRA) jira at hibernate.atlassian.net
Thu Jun 18 05:11:31 EDT 2020


LAdO ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A1457ac20-703a-4313-96f5-fa81da333677 ) *commented* on HHH-8511 ( https://hibernate.atlassian.net/browse/HHH-8511?atlOrigin=eyJpIjoiZDkyNTNhNTdhNzliNDg4Njg3NDcxNDhlZWNkMjRmY2EiLCJwIjoiaiJ9 )

Re: "Can't convert fromnull" when inserting clob in Informix ( https://hibernate.atlassian.net/browse/HHH-8511?atlOrigin=eyJpIjoiZDkyNTNhNTdhNzliNDg4Njg3NDcxNDhlZWNkMjRmY2EiLCJwIjoiaiJ9 )

The same error occurred in the latest Hibernate master branch (5.5.0-SNAPSHOT) when using Informix JDBC Driver version 3.70.JC8.

Caused by: java.sql.SQLException: Can't convert fromnull
	at com.informix.util.IfxErrMsg.getSQLMinorException(IfxErrMsg.java:547)
	at com.informix.jdbc.IfxObject.fromCharacterStream(IfxObject.java:706)
	at com.informix.jdbc.IfxValue.a(IfxValue.java:929)
	at com.informix.jdbc.IfxPreparedStatement.setCharacterStream(IfxPreparedStatement.java:4440)
	at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$3$1.doBind(ClobTypeDescriptor.java:129)
	at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:73)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:276)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:271)
	at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:39)
	at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2948)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3245)
	... 34 more

@Lars Blomenkamp's suggestion helped with this version

@Override
public boolean useInputStreamToInsertBlob () {
   return false ;
}

Conversely, when using the Informix JDBC Driver version 4.10.JC12, everything is OK. If useInputStreamToInsertBlob () returns false, the database returns incorrect data.

java.lang.AssertionError: 
Expected: is "xxxxxxxxxx"
    but: was " xxxxxxxxxx"

The unit test is in the attachment InformixLobStringTest.java ( https://hibernate.atlassian.net/secure/attachment/49703/49703_InformixLobStringTest.java )

( https://hibernate.atlassian.net/browse/HHH-8511#add-comment?atlOrigin=eyJpIjoiZDkyNTNhNTdhNzliNDg4Njg3NDcxNDhlZWNkMjRmY2EiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-8511#add-comment?atlOrigin=eyJpIjoiZDkyNTNhNTdhNzliNDg4Njg3NDcxNDhlZWNkMjRmY2EiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100129- sha1:b514962 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200618/171d5d5c/attachment.html 


More information about the hibernate-issues mailing list