-
Notifications
You must be signed in to change notification settings - Fork 477
Spring MyBatis Hello World tutorial #7498
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
Conversation
374b17c to
629acd6
Compare
629acd6 to
d724c56
Compare
d724c56 to
449c1ee
Compare
449c1ee to
c076104
Compare
|
@jeffgbutler Cheers! |
|
I think this looks really good. Couple of things to think about:
|
|
TFTR, @jeffgbutler!
Although TestContainers does have a module for Cockroach, we can't officially claim beta support with TestContainers at the moment (we're looking into it in the upcoming quarter). So, we probably want to avoid recommending the tool in our docs. Also, in the interest of simplifying things, it's a good idea to avoid introducing additional tooling where possible. Perhaps we should leave it out of the tutorial, but keep it in the repo?
Batching reads/writes does add more complexity to the sample... but we do call out using batch writes as a best practice in our docs. And we implement batch inserts in the other Java examples (e.g., https://www.cockroachlabs.com/docs/v20.1/build-a-java-app-with-cockroachdb.html). And, as you noted, we have a performance recommendation to use batch sizes of 128 (e.g., https://www.cockroachlabs.com/docs/v20.1/build-a-java-app-with-cockroachdb.html#use-a-batch-size-of-128), with some sample logic that is functionally similar to what you have in
No worries! Makes total sense. :) |
|
@ericharmeling makes sense about TestContainers. I'll definitely leave it in the repo. |
Sounds good! |
c076104 to
687012f
Compare
|
@jeffgbutler After looking into this more, I believe I was wrong about the batch size recommendation extending beyond our JDBC compatibility to other ORMs.
I think that's a good idea. Please see jeffgbutler/mybatis-cockroach-demo#2 for my attempt at simplifying things. @lnhsingh |
Fixes #7737.
Fixes #6040.
Related to #6046.
This PR includes:
The code referenced by this tutorial is located here: https://github.com/jeffgbutler/mybatis-cockroach-demo/tree/master/src.
I made a couple minor changes to the application that are reflected in the .java files in this PR and in the tutorial:
Those changes are reflected in a fork of the repo: https://github.com/ericharmeling/mybatis-cockroach-demo/tree/transaction-retries.