I have a problem with hibernate and MySQL and inserting a blob.
In our previous version of hibernate (3.6.0) a blob was inserted into the database
Now the blob is persisted with BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING.
(see org.hibernate.type.descriptor.sql.BlobTypeDescriptor.DEFAULT and the doBind method)
The latter uses twice (2x!) the number of bytes (I think a byte is encoded as hex) as the streaming option.
In our junittest we now get the exception "com.mysql.cj.jdbc.exceptions.PacketTooBigException"
I noticed that the problem doesn't exist for Clob. A solution for Clob is made in org.hibernate.dialect.Dialect.
I think the same solution should be made for Blob.
In Dialect.java the following code is in method Dialect.getSqlTypeDescriptorOverride(int sqlCode):
The method could be changed to: