glassfish
  1. glassfish
  2. GLASSFISH-285

problem with EXTENDED persistency and stateful session beans

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      285

      Description

      using

      @PersistenceContext(type=EXTENDED)
      private EntityManager entityManager;

      in a @Stateful session bean results in a

      ...

      java.lang.IllegalArgumentException: Can not PERSIST detatched object:

      ...

      when acessing an entity of type SomeEntity the second time

      of course this can be solved the 'brute-force' way
      by always detaching the entity using ...

      entityManager.find(SomeEntity.class, someEntityId);

      ... but was the whole goal of EXTENDED not to just avoid that?

      ps: maybe this bug has already been filed,
      anyway, I have attached a zip file
      (complete minimal ant project) to reproduce the bug

        Activity

        Hide
        lucduponcheel added a comment -

        Created an attachment (id=86)
        complete ant project (I use glassfish-9.0-b37)

        Show
        lucduponcheel added a comment - Created an attachment (id=86) complete ant project (I use glassfish-9.0-b37)
        Hide
        shanchen added a comment -

        It should have been fixed. Now if the same object already exists in the
        cache, EntityExistsException would be thrown on persist. If the same object
        exists in the database, but not the cache, database would throw a unique
        constraint violated exception on commit.

        Show
        shanchen added a comment - It should have been fixed. Now if the same object already exists in the cache, EntityExistsException would be thrown on persist. If the same object exists in the database, but not the cache, database would throw a unique constraint violated exception on commit.

          People

          • Assignee:
            tware
            Reporter:
            lucduponcheel
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: