Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-6175

JPAPlaceholderResolverStrategy accept() method accepts entities its EntityManager does not handle them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 7.1.0.Final
    • jBPM 6.4.0.Final, jBPM 6.5.0.Final, 7.0.0.Final
    • Persistence, Runtime Engine
    • None
    • NEW
    • NEW
    • Hide

      Define two JPAPlaceholderResolverStrategy targeting different persistence units (and maybe different datasources) in the same deployment descriptor.

      Show
      Define two JPAPlaceholderResolverStrategy targeting different persistence units (and maybe different datasources) in the same deployment descriptor.

      The accept() method of the JPAPlaceholderResolverStrategy is accepting any object that is an @ Entity despite its EntityManager does not handle these entities.
      The current approach only uses reflection to guess if an object is an entity.

      It is possible to validate which entities handles an EntityManager asking for the metamodel:
      if( em != null ){
      Set<EntityType<?>> entities = em.getMetamodel().getEntities();
      for( EntityType<?> entity : entities ){
      if( varClass.getCannonicalName().equals( entity.getJavaType().getCanonicalName() )

      { return true; }

      }
      }

      This bug, linked with DROOLS-1629 is limiting the posibility that a project uses two different datasources in the same runtime environment.

              swiderski.maciej Maciej Swiderski (Inactive)
              ngs_mtech_jira Manuel Castro (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: