pgjdbc-ng
pgjdbc-ng copied to clipboard
Make LargeObject API public
I'd like to implement a TransactionalBlobInputStream which takes a BlobInputStream as input and ensures there's an active transaction before calling read() etc., reconnecting and seek()-ing if necessary.
Thinking about something like this:
public TransactionalBlobInputStream(BlobInputStream bis) {
// getLargeObject doesn't exist on BlobInputStream
this.lo = big.getLargeObject;
}
public int read() {
// Use Spring's TransactionSynchronizationManager.isActualTransactionActive
// to test if there's an open TX and test if this.lo is useable,
// or re-connect and create new LargeObject if necessary
}
How about making more stuff public/protected so one may override stuff and extend it?
Thanks
Yes the LargeObject API will be moved into the .api. package soon
Nice! Does that mean the OID used will be available from the BlobInputStream and that one will be able to creaate new LargeObject instances with a specified OID and java.sql.Connection as arguments?
Thanks.
Any progress on making the LargeObject API public? I need this for making a custom InputStream dealing with automatically re-fetching a java.sql.Blob from DB if the connection is closed