pgjdbc-ng icon indicating copy to clipboard operation
pgjdbc-ng copied to clipboard

Make LargeObject API public

Open andreak opened this issue 11 years ago • 3 comments

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

andreak avatar Dec 10 '13 23:12 andreak

Yes the LargeObject API will be moved into the .api. package soon

kdubb avatar Dec 11 '13 18:12 kdubb

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.

andreak avatar Dec 11 '13 18:12 andreak

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

andreak avatar Jan 09 '14 08:01 andreak