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

GROOVY-8288 executeBatch() should not be called with batchCount == 0 #586

Closed
wants to merge 1 commit into from
Closed

GROOVY-8288 executeBatch() should not be called with batchCount == 0 #586

wants to merge 1 commit into from

Conversation

akapps
Copy link
Contributor

@akapps akapps commented Aug 15, 2017

This is a first proposition of resolution for GROOVY-8288.
There still are open questions (see my comments on changes).

Thank you for your feedback.

def result = sql.withBatch { ps ->
// Do nothing - not a good practice at all...
}
assert result == [] as int[]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is quite surprising at first sight that HSQL driver behaves differently if executeBatch() is called with nothing added to the batch, whether a preparedStatement is used or not.

I felt like it's not Groovy responsibility to "suppress" the exception for the preparedStatement case, and I wanted to test-specify those 2 behaviours as they are the current ones.

@asfgit asfgit closed this in 0a612c2 Sep 15, 2017
@daniellansun
Copy link
Contributor

Merged. Thanks!

asfgit pushed a commit that referenced this pull request Sep 15, 2017
asfgit pushed a commit that referenced this pull request Sep 15, 2017
asfgit pushed a commit that referenced this pull request Sep 15, 2017
avafanasiev pushed a commit to avafanasiev/groovy that referenced this pull request Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants