2 Replies Latest reply on Mar 9, 2005 8:19 PM by Paul Walker

    FKs must be allow null ???

    Leandro Terra Melo Newbie

      Hi,
      i cannot insert a data in one table because it's FK doesn't allow null and i only set the FKs in ejbPostCreate(), as it should be.

      So, do i have to make all my FKs allow null or there's other solution?

      Thanks,
      ltcmelo

        • 1. Re: FKs must be allow null ???
          Marek Neumann Novice

          see 'insert-after-ejb-post-create' in jboss.xml, IMHO since 3.2.2.

          -marek

          • 2. Re: FKs must be allow null ???
            Paul Walker Newbie

            I changed the standardjboss.xml file to read the following:

            <container-configurations>

            <container-configuration>
            <container-name>Standard CMP 2.x EntityBean</container-name>
            <call-logging>false</call-logging>
            <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
            <sync-on-commit-only>false</sync-on-commit-only>
            <insert-after-ejb-post-create>true</insert-after-ejb-post-create>
            <call-ejb-store-on-clean>true</call-ejb-store-on-clean>

            I tried doing this within my own JBOSS.XML file using the following. . .

            <container-configurations>
            <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>
            </container-configurations>

            . . . but this did not seem to work. Changing the standart Jboss XML file worked great.