Hi gang, got a weird problem and hoping someone can give me a hint.
I have an Image class with binary data which I represent as byte[] (I also tried Blob which I may go back to as it probably will use less memory - streams instead of large byte arrays).
I have the proper mapping and my data saves fine (I can see my saved data using a DB tool outside my application) but for whatever reason I seem to have random read problems inside my application following my initial save.
i.e. I save a number of Blob records to the DB (doing a flush, commit, then clear after each) but then random records won't retrieve unless I kill the VM and start over at which point all records fetch fine.
Nothing gets thrown by Hibernate during the fetch (Session.get() or even Criteria.getUnique...), the fetch just returns null.
Running on Mac using JVM 1.6.0.17, MySQL J/Connector 5.1.8 and MySQL DB 5.1.37, and Hibernate 3.3.2.
I've looked for memory and connection leaks and haven't found anything obvious and am at a loss as to where to look.
This appears to be some kind of caching or session synchronization issue as I can see the saved records in the DB outside my running application I just don't seem to be able to fetch them inside my current application.
Any tips or hints appreciated.
Thanks,
Martin
|