ARTEMIS-2296 PgResultSet.updateBlob not implemented
There is no test for this as we don't have a way to embed/test Postgres. It will need to be verified externally. However, given the exception the fix looks solid.
This commit is contained in:
parent
838651ce62
commit
b4ce3305bf
|
@ -107,7 +107,7 @@ public final class PostgresSequentialSequentialFileDriver extends JDBCSequential
|
|||
}
|
||||
|
||||
@Override
|
||||
public int writeToFile(JDBCSequentialFile file, byte[] data) throws SQLException {
|
||||
public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException {
|
||||
synchronized (connection) {
|
||||
LargeObjectManager lobjManager = ((PGConnection) connection).getLargeObjectAPI();
|
||||
LargeObject largeObject = null;
|
||||
|
@ -116,7 +116,11 @@ public final class PostgresSequentialSequentialFileDriver extends JDBCSequential
|
|||
try {
|
||||
connection.setAutoCommit(false);
|
||||
largeObject = lobjManager.open(oid, LargeObjectManager.WRITE);
|
||||
largeObject.seek(largeObject.size());
|
||||
if (append) {
|
||||
largeObject.seek(largeObject.size());
|
||||
} else {
|
||||
largeObject.truncate(0);
|
||||
}
|
||||
largeObject.write(data);
|
||||
largeObject.close();
|
||||
connection.commit();
|
||||
|
|
Loading…
Reference in New Issue