I am having some performance issues with caching lazily-initialized LOBs. A large amount of time (>25% of total time according to JMC) is spent trying turn the byte into a String. Some of our bytes can be several MBs large, and this is hurting performance more than caching them improves performance in the first place.
I thought this could be related to https://hibernate.atlassian.net/browse/HHH-11097 but we are using 5.2.13. I have attached the stack trace in the images below. My entity class, which is lazily loaded, is below.
I see in https://github.com/hibernate/hibernate-orm/commit/c7c9e421454fd6c5c4ac426f39dffe9440a8ba37 that Clob and BlobTypeDescriptors should print BLOB(...). instead of trying to create a String. However, despite my @Lob annotation, it is still a PrimitiveByteArrayTypeDescriptor.