Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6383

Entities using Extended PersistentContext are not managed

XMLWordPrintable

    • Hide

      1. Create a Stateful bean with two service methods

      • One service method uses an Extended EntityManger to find an entity and caches it in the bean
      • In the second method, update the entity

      2. Have a servlet call both the service methods using @Inject bean

      Expected:
      Calling second method should automatically persist the data to DB

      Actual:
      The data is not persisted. Its the same issue even if you call em.flush() explicitly. Basically the Entity is not managed

      Show
      1. Create a Stateful bean with two service methods One service method uses an Extended EntityManger to find an entity and caches it in the bean In the second method, update the entity 2. Have a servlet call both the service methods using @Inject bean Expected: Calling second method should automatically persist the data to DB Actual: The data is not persisted. Its the same issue even if you call em.flush() explicitly. Basically the Entity is not managed

      Entities using Extended PersistentContext are not managed in a Stateful bean.

      Attached are the bean class and the client servlet class

        1. CdiStatefulEmployeeBean.java
          1.0 kB
        2. AtInjectedStatefulEjbClient.java
          1 kB
        3. StatefulEjbClient.java
          1 kB
        4. StatefulEjb.java
          1 kB
        5. WFLY-6383.zip
          7 kB

              Unassigned Unassigned
              rakcheru Rakesh Cherukuri (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: