I\'m looking for a way to stream binary data to/from database. If possible, i\'d like it to be done with Hibernate (in database agnostic way). All solutions I\'ve found invo
Your solution using Hibernate's lobHelper should work, but you may need to make sure that the use of streams is enforced. Set property hibernate.jdbc.use_streams_for_binary = true This is a system-level property, so it has to be set at startup (I defined it on the command line during testing:
java -Dhibernate.jdbc.use_streams_for_binary=true blobTest
You can prove it's changed in your code:
Object prop = props.get("hibernate.jdbc.use_streams_for_binary");
System.out.println("hibernate.jdbc.use_streams_for_binary" + "/" + prop);