JetBrains / JetBrains/Exposed

Possible incorrect usage of supportMultipleResultSets database information.

Open
#1,438 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
9.3k
Forks
798
Avg merge
4d 2h
Merged PRs (30d)
26

Description

Case:
```

fun AbstractQuery.lazySequence():Sequence<*>{
val resultSet= transaction.exec(it)
// transform resultSet into sequence
}
fun foo() = transaction{

MyBigTable.selectAll().lazySequence().forEach{
if(someCheck(it)){
MyOtherTable.update{
// someCode
}
}
}
}

```

But i have a closed result set exception. Closing result set happens at [Statement](https://github.com/JetBrains/Exposed/blob/fd63d487ea91c5ecaae9208d55c88d4b0b00094f/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/statements/Statement.kt#L57)

I'm not sure, but [javadoc](https://docs.oracle.com/javase/10/docs/api/java/sql/DatabaseMetaData.html#supportsMultipleResultSets() ) talks only about multiple resultSet in single execute statement, not about whole transaction.

May be exposed do not have to close all result sets when it execute another?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.