2 Replies Latest reply on May 11, 2004 5:00 PM by jeeads

    Multiple container configuration for one entity

    jeeads

      Deployment error:
      2004-05-11 11:03:55,625 ERROR [org.jboss.metadata.XmlFileLoader] failed to load jboss.xml.
      There could be a syntax error.
      org.jboss.deployment.DeploymentException:
      Error in jboss.xml for Bean MSSQLServer2000MetaData_ActivityEventCode:
      expected only one configuration-name tag

      I am trying to use both configurations since I need optimistic locking and insert after post
      create. When I try to deploy I get an error because there are two configuration-names. Is
      there a way around this?

      < entity>
      < ejb-name>MSSQLServer2000MetaData_Users</ejb-name >
      < local-jndi-name>MSSQLServer2000MetaData_Users</local-jndi-name >
      < !-- Non nullable foreign keys use a specific configuration so inserts follow post create. -- >
      < configuration-name>INSERT after ejbPostCreate Container</configuration-name >
      < !-- Optimistic locking uses a specific configuration -- >
      < configuration-name>Optimistic Container</configuration-name >


      < container-configurations>
      < !-- <Extends Standard CMP 2.x EntityBean for the purpose of inserting record after post create>-- >
      < container-configuration extends="Standard CMP 2.x EntityBean">
      < container-name>INSERT after ejbPostCreate Container</container-name >
      < insert-after-ejb-post-create>true</insert-after-ejb-post-create >
      </container-configuration >
      < !-- <Extends Per Transaction for the purpose of Optimistic Locking JE 8/18/2003> -- >
      < container-configuration extends="Instance Per Transaction CMP 2.x EntityBean">
      < container-name>Optimistic Container</container-name >
      < !-- <overrides: org.jboss.ejb.plugins.lock.noLock> -- >
      < locking-policy>org.jboss.ejb.plugins.lock.OptimisticLocking</locking-policy >
      </container-configuration >
      </container-configurations >

        • 1. Re: Multiple container configuration for one entity
          jae77

          you will have to define one configuration that uses both optimistic locking and the insert after create settings.

          if you need to use the configurations seperately (ie, one for locking and one for insert after create), then you will have to define the bean twice (once for each configuration) with different jndi names.

          then in your code, you'll look up the correct jndi name for the action (lock or post create) you want.

          • 2. Re: Multiple container configuration for one entity
            jeeads

            Since each configuration extends different configurations how would you combine the two?

            Thanks
            Jerry