Hi,

 

I have an abstract ejb (@ejb.bean … generate=”false”, where I have some methods already implemented:

Create(object).

Modify(object).

Delete(object).

 

All those methods are declared with @ejb.transaction type=”Required” (Actually this tag is defined for the @ejb.bean and only the read method override them to Supports).

 

findByPrimaryKey(Long) with @ejb.transaction type=”Supports”

findByIdentifier(String) with @ejb.transaction type=”Supports”

 

The ejbs descendants of the above ejb most of the time don’t have to override the above methods.

But for the “read” methods, I declare them with @ejb.transaction type =”Supports”

 

My problem is that the ejb-jar.xml is being generated with the name of the abstract EJB for the overriding methods, instead of using the right name.

Ex.:

 

Abstract ejb =

            /**

 * @ejb.bean name="TransferObjectManager" generate="false"

 * @ejb.transaction type="Required"

 */

Public class TransferObjectBean implements SessionBean {

Public create(…) {…}

Public modify(…) {…}

Public  delete (…) {…}

            }

 

Descendant

            /**

  * @ejb.bean    name="VocabularyManager"

  *                     jndi-name="ejb/remote/ VocabularyManager "

  *                     local-jndi-name="ejb/local/ VocabularyManager "

  *                    view-type="local"

              *                     type="Stateless"

  *                     transaction-type="Container"

  *                     generate="true"

              */       

            Public class VocabularyBean extends TransferObjectBean {

                        /**

                          * @ejb.interface-method

                          * @ejb.transaction type=”Supports”

                          */

                        Public void findByXXX() {…}

            }

 

 

My DD looks like:

<container-transaction >

      <method >

         <ejb-name> VocabularyManager </ejb-name>

          <method-name>*</method-name>

       </method>

       <trans-attribute>Required</trans-attribute>

    </container-transaction>

   <container-transaction >

      <method >

         <ejb-name> VocabularyManager </ejb-name>

         <method-intf>Local</method-intf>

         <method-name>findByXXX</method-name>

         <method-params>

            <method-param>java.lang.Object< /method-param>

         </method-params>

      </method>

      <trans-attribute>Supports</trans-attribute>

   </container-transaction>

   <container-transaction >

      <method >

         <ejb-name>TransferObjectManager</ejb-name>

         <method-intf>Local</method-intf>

         <method-name>findByPrimaryKey</method-name>

         <method-params>

            <method-param>java.lang.Long</method-param>

         </method-params>

      </method>

      <trans-attribute>Supports</trans-attribute>

   </container-transaction>

   <container-transaction >

      <method >

         <ejb-name>TransferObjectManager</ejb-name>

         <method-intf>Remote</method-intf>

         <method-name>findByPrimaryKey</method-name>

         <method-params>

            <method-param>java.lang.Long</method-param>

         </method-params>

      </method>

      <trans-attribute>Supports</trans-attribute>

   </container-transaction>

   <container-transaction >

      <method >

         <ejb-name>TransferObjectManager</ejb-name>

         <method-intf>Local</method-intf>

         <method-name>findByIdentifier</method-name>

         <method-params>

            <method-param>java.lang.String</method-param>

         </method-params>

      </method>

      <trans-attribute>Supports</trans-attribute>

   </container-transaction>

   <container-transaction >

      <method >

         <ejb-name>TransferObjectManager</ejb-name>

         <method-intf>Remote</method-intf>

         <method-name>findByIdentifier</method-name>

         <method-params>

            <method-param>java.lang.String</method-param>

         </method-params>

      </method>

      <trans-attribute>Supports</trans-attribute>

   </container-transaction>

 

 

The findByXXX uses the right ejb name, but as you see, the findByPK and findByIdentifier holds TransferObjectManager as ejb-name, instead of the real name – VocabularyManager. And for each manager I have, I see the same <container-transaction> tags for the findByPK and findByIdentifier with TransferObjectManager instead of the real ejb name.

 

PS.: TransferObjectManager is never defined with <session > </session> tags, since I have the generate=”false” (and this seems to work fine).

 

Is this an XDoclet bug, or am I doing something wrong?

 

Thanks for the help,

Marcelo.           

Reply via email to