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

[CBRD-24063] Error occurs when Connection.close() is called multiple times in Server-side JDBC #19

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

hgryoo
Copy link
Member

@hgryoo hgryoo commented Sep 27, 2021

http://jira.cubrid.org/browse/CBRD-24063

When entering SP function body in ExecuteThread, The thread has INVOKE status. and If Server-side JDBC opens Connection, ExecuteThread has CALL status and CAS enters libcas_main(). disconnect() should be called only when CAS is in CALL state to exit from libcas_main(), otherwise it should do nothing.

// ExecuteThread.java
    private void processStoredProcedure() throws Exception {
        ...

        setStatus(ExecuteThreadStatus.INVOKE);
        Object result = m.invoke(null, resolved);

        /* close server-side JDBC connection */
        closeJdbcConnection(); // NOTE: If there is Connection.close() in function body, status is INVOKE. otherwise CALL.

        ...
    }

@hgryoo hgryoo marked this pull request as ready for review September 27, 2021 07:30
@hgryoo hgryoo requested a review from beyondykk9 October 5, 2021 05:35
new Class[] {Integer.class},
this.curThread,
new Object[] {INVOKE});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not matter missing else clause?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, It does nothing on other statuses

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

Successfully merging this pull request may close these issues.

2 participants