Skip to content

JpaItemWriter description in Appendix of documentation is wrong #5556

Closed

Description

@marschall

The appendix in the reference documentation has the following to say about JpaItemWriter

This item writer is JPA EntityManager-aware and handles some transaction-related work that a non-“JPA-aware” ItemWriter would not need to know about and then delegates to another writer to do the actual writing.

I have the following issues with this:

  • The only really transaction related thing it's doing is getting a transactional EntityManager
  • It does not actually delegate to another writer, it either calls EntityManager#persist or EntityManager#merge

Activity

  1. added
    status: waiting-for-triage
    on Sep 25, 2026
  2. Akhil-1527 commented on Sep 26, 2026

    @Akhil-1527
    Contributor

    Hi, I'd be happy to fix this. I'd reword the JpaItemWriter row in the appendix to match what the writer does: it gets the transactional EntityManager, calls persist or merge for each item the EntityManager doesn't already manage, and flushes at the end of each chunk. The part about delegating to another writer would go. If that sounds right, I'll open a PR.

  3. marschall commented on Sep 26, 2026

    @marschall
    ContributorAuthor

    Sounds about right, you could add that it optionally calls clear on the EntityManager after each chunk.

  4. added
    for: backport-to-6.0.x
    and removed
    status: waiting-for-triage
    on Oct 1, 2026
  5. added this to the 6.1.0-RC1 milestone on Oct 1, 2026
  6. added a commit that references this issue on Oct 1, 2026
    290593b
  7. added a commit that references this issue on Oct 2, 2026
    0565ed4
  8. changed the title [-]JpaItemWriter descrition in Appendix of documentation is wrong[/-] [+]JpaItemWriter description in Appendix of documentation is wrong[/+] on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: backport-to-6.0.xin: documentationtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions