Announcement Announcement Module
Collapse
No announcement yet.
sub transaction Requires_New get detached object Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • sub transaction Requires_New get detached object

    Hi,

    I have the problem that when i make a sub-transaction with propagation Requires_New that i get a detached object after persist (or merge) on the first transaction.

    For indication I use JPA with EntityManager and with Spring 2.5.

    So do you know how I could get my object persisted not detached after the end of the sub transaction ?
    For that I would like to avoid a find request, because in waiting I know only this solution, and due to overload I would like to avoid that...

    thanks for any help

  • #2
    Nobody has any idea ? I'm looking for any suggestion...

    Comment


    • #3
      So it seems that the solution is to works with that :

      Code:
      <bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
            <property name="entityManagerFactory" ref="entityManagerFactory"/>
          </bean>
      So I use the SharedEntityManager... Do you have any recommendation about that ? some warning ?

      thanks

      Comment

      Working...
      X