mrkeyoor.comAsk

mybatis/mybatis-3tested 07 Oct 2026commit 34147d0

mybatis-3 review

Consider MyBatis when your Java team wants to own its SQL and result mappings and can enforce session and transaction discipline.

  • Build failed
585 sto install
  • Tests failed
Dataevaluationupdated 26 Oct 2026
+7stars / 7d

MyBatis is a Java SQL mapper that connects objects to SQL statements or stored procedures through XML descriptors or annotations. It suits teams that want to write their SQL and define how database results become application objects.

Verdict

Consider MyBatis when your Java team wants to own its SQL and result mappings and can enforce session and transaction discipline. Our October 7, 2026 run of commit 34147d0 stopped before compilation and test execution because Maven 3.9.9 was below that checkout's 3.9.16 minimum. It provides no runtime performance result and no individual test outcome. For a source evaluation, first satisfy that checkout's toolchain requirement; for application adoption, evaluate a representative mapper and transaction flow with your database.

We ran it

Lab card: what happened when we ran mybatis-3
Lab card from our sandbox run
Screenshot of mybatis-3 (mybatis.github.io/mybatis-3)
mybatis.github.io/mybatis-3
Install✓ · 585s
Build✗ · 10s
Tests✗ · 8sran, no count parsed
Repo2073 files~116,941 lines of source · 6.6 MB · 7 CI workflows

Answers from our run

Does mybatis-3 build from source?

Dependencies installed in 585 seconds, and the build failed. We cloned commit 34147d0 into a clean Debian container with 3 CPUs and no project-specific setup.

Do mybatis-3's tests pass?

No. The project's own test command exited unsuccessfully after 8 seconds, and its output did not expose an individual test count.

Who should not use mybatis-3?

Teams seeking persistence driven primarily by an entity model rather than mapped SQL.

What are the alternatives to mybatis-3?

jOOQ, Hibernate ORM. Consider MyBatis when your Java team wants to own its SQL and result mappings and can enforce session and transaction discipline.

Setup2/5Limited validation: on October 7, 2026, commit 34147d0 completed the install-labelled step in 585 seconds, but build and test commands stopped at Maven enforcement after 10 and 8 seconds. Application setup was not exercised.
Docs4/5Detailed supporting evidence: the supplied getting started, Java API and mapper XML guides explain configuration, mappings, session lifecycle, transactions and caches. Their examples were not executed in our run.
Community2/5Limited evidence: issue 3574 includes a maintainer response and later participation. This does not establish adoption, typical response times or overall support quality.
Maturity3/5Documented release and development evidence: the guides identify version 3.5.19, while our checkout identifies 3.6.0-SNAPSHOT. Compatibility and operational reliability remain unvalidated by this run.

Who it’s for

Java developers who want explicit SQL and object mapping.
Teams working with stored procedures or schemas that need detailed result maps.
Maintainers willing to manage session scope and transaction behavior, directly or through the separate MyBatis-Spring or MyBatis-Guice integrations.

Who it’s NOT for

Teams seeking persistence driven primarily by an entity model rather than mapped SQL.
Applications that require a documented R2DBC API: the supplied MyBatis documentation describes JDBC connections and SqlSession.
Teams unable to enforce session ownership and cleanup: the getting started guide says SqlSession instances are not thread safe and must not be shared.

Setup reality

In our recorded run on October 7, 2026, commit 34147d0bd2f5ed0016ef367c92b25e174149326b identified itself as MyBatis 3.6.0-SNAPSHOT. The harness step labelled install exited successfully after 585 seconds. Its retained output does not establish what dependencies were downloaded or whether a usable library artifact was installed.

The build command exited with code 1 after 10 seconds, and the test command exited with code 1 after 8 seconds. Both stopped at Maven enforcement because Maven 3.9.9 did not satisfy the required range [3.9.16,). These results establish a source-build toolchain mismatch. They do not establish compilation failure or failing individual tests.

The recorded environment had 3 CPUs, 10 GB of memory and image label lab-jvm:21. That label does not verify the actual JDK version. The source scan recorded 7 CI workflows and no Dockerfile; its testsDir=false flag does not establish that the repository lacks tests.

Application setup is a separate task. The getting started guide describes adding the MyBatis JAR or Maven dependency, configuring a data source and transaction manager, and supplying mapper statements. The source-build Maven requirement observed here should not be presented as a requirement for every application consuming a published MyBatis release.

MyBatis leaves query design with your team

MyBatis maps SQL results to Java objects while leaving SQL statements in XML or annotations. That is useful when reviewing the actual query is part of maintaining the application. It also means the team must maintain the query and its mapping together.

The getting started guide shows both XML statements and annotated mapper interfaces. Annotations suit simple statements; the guide says the most advanced mappings, including nested join mapping, still require XML. Treat the README's claim that simplicity is its biggest advantage as the project's assessment, rather than a measured comparison with other persistence tools.

What our recorded run established

Our run was recorded on October 7, 2026 at commit 34147d0bd2f5ed0016ef367c92b25e174149326b. The build output identified the checkout as MyBatis 3.6.0-SNAPSHOT. This is distinct from the supplied documentation labelled version 3.5.19, last published January 2, 2025.

The harness step labelled install returned exit code 0 after 585 seconds. Its retained tail contains only a JAVA_TOOL_OPTIONS message. That is evidence of successful step completion, without enough output to verify dependency downloads or installation of a usable artifact.

The build command returned exit code 1 after 10 seconds. The test command returned exit code 1 after 8 seconds. Both stopped at the same Maven enforcer rule: installed Maven 3.9.9 was outside the allowed range [3.9.16,). The retained logs show enforcement before compilation or test execution. No individual test results were recorded, so these commands do not show that MyBatis tests failed.

The environment record lists 3 CPUs, 10 GB of memory and image lab-jvm:21. The image name alone does not verify the running JDK. The scan recorded 2,073 files, approximately 116,941 source lines, a 6.6 MB checkout and 7 CI workflows. It detected no Dockerfile. Its testsDir=false flag is a detection result, not an inventory of test coverage.

The README lists test counts that vary by platform and JDK and explains that some tagged groups are excluded by default. Those are upstream statements, not passing-test counts from our run. We performed no new execution, database workload or performance benchmark for this review.

Adding the library differs from building its source

The getting started guide describes using the MyBatis JAR or a Maven dependency. Application configuration includes a data source, transaction management and mapper definitions. A SqlSessionFactory supplies sessions through which the application executes mapped statements.

Our Maven mismatch belongs to the measured 3.6.0-SNAPSHOT source checkout. It does not demonstrate that consuming the published 3.5.19 library requires Maven 3.9.16. Before contributing to that checkout, use a Maven version accepted by its build and check its test exclusions. Before application adoption, configure a representative query against your own database.

Session ownership is part of the adoption decision

The getting started guide says each thread should have its own SqlSession and that sessions are not thread safe. Keep unmanaged sessions within a request or method and close them reliably. The guide uses try-with-resources for this purpose.

The Java API guide describes the default session as having a transaction scope without auto-commit, a connection obtained from the configured data source and the driver's or data source's default isolation level. It also documents explicit commit and rollback behavior. MyBatis-Spring and MyBatis-Guice provide separate integration paths for declarative transaction handling.

For an adoption trial, check a successful write and a rolled-back write with the transaction configuration you intend to deploy. This is a recommended next step, not work completed in our recorded run.

Result mapping and SQL substitution need review

The mapper XML guide describes automatic mapping for simple results and explicit result maps for more complex relationships. Start with a small mapping and verify its returned objects before expanding it.

The guide also distinguishes parameter binding through #{} from direct string substitution through ${}. It warns against passing user input unchanged into substituted SQL. This is a documented usage constraint, not a security finding from our sandbox.

The Java API guide documents a session-local cache and a second-level cache. The XML guide describes namespace cache configuration and cache references. Include cache behavior in your mapper review if you enable it; our run did not exercise either cache.

The OGNL report does not settle release impact

Issue 3574 contains a user's report of high-concurrency thread blocking, naming MyBatis 3.5.19 and OGNL 3.4.9. A maintainer replied that OGNL 3.4.9 had only just been merged and was unreleased for MyBatis, and asked for clarification of the affected version.

That exchange leaves the report's release attribution unresolved in the supplied evidence. It does not establish that released MyBatis 3.5.19 contains the stated OGNL version or that every high-concurrency service is affected. We did not reproduce the report, and the supplied extract does not verify the previously asserted upgrade pull request.

Choosing a persistence approach

jOOQ describes itself as an internal DSL and source code generator that models SQL as a type-safe Java API. Consider it when query construction in Java and generated types are the desired workflow.

Hibernate ORM describes object/relational mapping and synchronization of in-memory changes with the database. Consider it when that object persistence model matches the application.

MyBatis fits the reader who wants explicit SQL coupled to Java mappings. Our source-build result leaves compilation, test outcomes, database compatibility and runtime performance unverified. A representative mapper and transaction trial is the next useful check.

How to read the scores

These are editorial assessments of the supplied evidence, not benchmark results. The scale is 1 for major demonstrated obstacles or little usable evidence, 2 for limited validation, 3 for a documented path with material gaps, 4 for detailed supporting evidence and 5 for broad corroboration. Missing evidence reduces confidence rather than proving poor product quality.

Setup receives 2/5 because source validation stopped at toolchain enforcement and application setup was not exercised. Documentation receives 4/5 because the supplied guides explain configuration, mapping, session lifecycle, transactions and caches. Community receives 2/5 because the issue exchange shows participation but does not establish adoption or representative support responsiveness. Maturity receives 3/5 because a documented 3.5.19 release and a later 3.6.0-SNAPSHOT checkout are visible, while compatibility and operational reliability were not validated.

Alternatives

ProjectWhat it isPick it when
jOOQA Java SQL DSL and source code generator.Choose jOOQ when you want SQL expressed through a type-safe Java API with code generation.
Hibernate ORMA Java object/relational mapping solution that can synchronize in-memory changes with the database.Choose Hibernate ORM when synchronizing changes to application objects with relational data is the persistence behavior you want.

What people are saying

  1. [velocity-scout] mybatis/mybatis-3

Sources

  1. MyBatis 3 repository and README
  2. MyBatis 3 getting started guide
  3. MyBatis 3 Java API guide
  4. MyBatis 3 SQL map XML guide
  5. MyBatis 3.5.19 release
  6. MyBatis issue 3574 about OGNL lock contention

More data reviews