Skip to content

Provide support for declarative TX and transactional observers #65

@gunnarmorling

Description

@gunnarmorling

Hey, first of all, thanks a lot for this project, it's very helpful!

One thing I was missing is support for declarative TX control (via @Transactional) and transactional observers. This needs JTA to be hooked up.

I figured out the steps needed and added an example to our demos repo in Hibernate: hibernate/hibernate-demos#39

Also planning to write a blog post about this, but actually it'd be great if this was working out-of-the-box in Weld JUnit. I.e. there could be a new module, "persistence" or so, which does all the things I had to do manually:

  • Provide producers for EM and EMF
  • Inject the BM into Hibernate so that DI works in JPA entity listeners
  • Set up JTA via Narayana, bringing support for @Transactional
  • Hooking up TransactionServices so that Weld can make use of JTA and support transactional observers and injection of the UserTransaction

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions