Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove restriction to only allow calls to getResultSet if the result set was not returned yet #762

Closed
caxzan opened this issue Sep 11, 2023 · 4 comments

Comments

@caxzan
Copy link

caxzan commented Sep 11, 2023

When I am linking with a third-party software, the third-party software calls the data link of Firebird and executes an SQL statement. At this time, it returns an error statement: Only one result set at a time/statement, May I ask how to avoid this problem, or if it can be directly solved in Firebird's JAR.
image

@mrotteveel
Copy link
Member

mrotteveel commented Sep 11, 2023

Jaybird throws this exception because it already returned the result set, either as the return value of executeQuery or from a previous call to getResultSet for this execution of the statement. It does this because the JDBC API says " This method should be called only once per result.". However, looking at the API documentation, I'm not entirely sure that is the behaviour intended by the JDBC specification. I'll try to find out more.

Is this weaver.conn.RecordSet your own code?

@mrotteveel mrotteveel self-assigned this Sep 11, 2023
@mrotteveel
Copy link
Member

Looking at the JDBC spec, calling getResultSet multiple times or after the result set has been returned by executeQuery is not disallowed, it just recommends that it should not be done, as such no exception should be thrown. Also, I looked at the PostgreSQL and Microsoft SQL Server JDBC driver implementations, and they return the existing result set without a fuss.

I'll make the necessary changes in Jaybird 6.

@mrotteveel mrotteveel added this to the v6-initial milestone Oct 27, 2023
mrotteveel added a commit that referenced this issue Oct 27, 2023
…sult set was not returned yet

Deprecates FirebirdStatement.getCurrentResultSet.
@mrotteveel mrotteveel changed the title Only one result set at a time/statement. Remove restriction to only allow calls to getResultSet if the result set was not returned yet Oct 27, 2023
@mrotteveel
Copy link
Member

Decided to backport this to Jaybird 5.0.5 as well, see #809

mrotteveel added a commit that referenced this issue Jun 14, 2024
#762 Remove restriction to only allow calls to getResultSet if the result set was not returned yet
@caxzan
Copy link
Author

caxzan commented Jun 26, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants