Andy wrote:
Googling around, this appears to be because there is no current transaction at the time of the call. From what I can tell, there should be: we're using a Hibernate connection pool (and expecting Hibernate to run with autocommit off) and calling Session.beginTransaction() to start a new transaction before the Query is run).
This was indeed the problem. I had a DAO search method that was basically returning the results of the query and then closing the transaction. Because the blob data of the resulting objects wasn't being read until after the connection was closed, Postgres couldn't retrieve the blob data.
So I've taken the commit out of the DAO search method, but now I'm left with lots of open transactions, consuming processes on the server. Not sure how best to deal with this, so I've
posted again...