Announcement Announcement Module
Collapse
No announcement yet.
EntityManager in JpaDaoSupport Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EntityManager in JpaDaoSupport

    hey guys.

    Am using spring-framework-2.0-m2-with-dependencies-build.398-20060118.zip as a starting point for playing around with Hibernate EM and Spring support.

    Question:
    How do i get an EM from within a service bean extending JpaDaoSupport? I used the getEntityManager method of JpaDaoSupport and it returned null. I also tried getJpaTemplate().getEntityManager(). It also returned null.
    thus this mean that i should just create an EM from the EM factory. But my guess is this wont participate in transactions that may be ongoing.

  • #2
    Have the same problem.
    Should EntityManager be injected the way EntityManagerFactory is injected into all my DAOs?

    Thanks,

    Comment


    • #3
      use getJpaTemplate().execute and implement the jpacallback.

      you will be passed an valid em w/c participates in txs

      Comment

      Working...
      X