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

Ability to get generated keys from execution of a prepared batch request #101

Merged
merged 2 commits into from Sep 29, 2015
Merged

Conversation

arteam
Copy link
Member

@arteam arteam commented Apr 27, 2014

Judging on the discussion from the user-group it seems as useful functionality.

As I am aware H2 doesn't support key generation in a batch (relevant issue), but HSQLDB does.
So I had to add the HSQLDB dependency to test this functionality. Anyway, it seems a better solution then trying to start a MySQL database in unit-tests, as Brian pointed in the discussion.

I don't really like the way I've implemented this feature. Specifically, returning Object from internalBatchExecute method and then suppressing a warning from a compiler, but couldn't figure out how to generalize execute method and don't create an another abstraction level. The code seems to be too coupled.

I've chose the in-memory database mode in tests, because we don't need keep states between tests and maintaining a database in the memory is a lot simpler than in the disk. As we don't need many HSQLDB tests here, I think it's justified.

@stevenschlansker stevenschlansker merged commit 39f27b6 into jdbi:master Sep 29, 2015
stevenschlansker pushed a commit that referenced this pull request Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants