Skip to content

Commit

Permalink
ResultSet & Statement leaks in simple query #871 / Read bytes instead…
Browse files Browse the repository at this point in the history
… of inputStreams
  • Loading branch information
Tapac committed May 25, 2020
1 parent d0c1f01 commit a17d8ff
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ open class TextColumnType(collate: String? = null, val eagerLoading: Boolean = f
open class BasicBinaryColumnType : ColumnType() {
override fun sqlType(): String = currentDialect.dataTypeProvider.binaryType()

override fun readObject(rs: ResultSet, index: Int): Any? = rs.getBytes(index)

This comment has been minimized.

Copy link
@arbiter34

arbiter34 May 26, 2020

I think this addition alone should resolve the cases brought up in #871.

Granted if someone was using Impossibli strictly for the binary streaming this defeats the purpose, but I think that is likely a very small use case so they can write their own column type to handle their needs.


override fun valueFromDB(value: Any): Any = when (value) {
is Blob -> value.binaryStream.use { it.readBytes() }
is InputStream -> value.use { it.readBytes() }
Expand Down

0 comments on commit a17d8ff

Please sign in to comment.