What does your <weblogic> element under build.xml look
like?

There is an error in the template file for
weblogic-ejb-jar.xml for XDoclet 1.2.3.  I have
attached a version of it with the correction necessary
to generate the <isolation-level> output at the method
level.

Here is what I used in my build.xml with your example
and it worked fine.

<target name="ejbdoclet" ...blah, blah, blah...>

     <ejbdoclet>

...blah, blah, blah...

     <weblogic destDir="${src.ejb-meta-inf.dir}"
               mergeDir="${xdoclet.merge.dir}"
              
templateFile="${weblogic.template.file}"
               validateXML="true"
               version="8.1"
               createtables="Disabled"
               xmlencoding="UTF-8"
     />

</ejbdoclet>            

It did not matter if I put the

@weblogic.transaction-isolation
TRANSACTION_READ_COMMITTED

tag at the class or method level or both.  In all
three cases, my <isolation-level> element was not
empty, but contained TRANSACTION_READ_COMMITTED as
expected.

CLASS LEVEL OUTPUT:

   <transaction-isolation>
     
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
      <method>
         <description><![CDATA[Transaction isolation
for SSBFacade]]></description>
         <ejb-name>SSBFacade</ejb-name>
         <method-name>*</method-name>
      </method>
   </transaction-isolation>


BOTH CLASS AND METHOD LEVEL OUTPUT:

   <transaction-isolation>
     
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
      <method>
         <description><![CDATA[Transaction isolation
for SSBFacade]]></description>
         <ejb-name>SSBFacade</ejb-name>
         <method-name>*</method-name>
      </method>
   </transaction-isolation>
   <transaction-isolation>

     
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>

      <method>
         <description><![CDATA[]]></description>
         <ejb-name>SSBFacade</ejb-name>
         <method-intf>Remote</method-intf>
         <method-name>loadAll</method-name>
         <method-params>
         </method-params>
      </method>
   </transaction-isolation>


METHOD LEVEL OUTPUT:

   <transaction-isolation>

     
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>

      <method>
         <description><![CDATA[]]></description>
         <ejb-name>SSBFacade</ejb-name>
         <method-intf>Remote</method-intf>
         <method-name>loadAll</method-name>
         <method-params>
         </method-params>
      </method>
   </transaction-isolation>


Thanks.


--- Tao Xie <[EMAIL PROTECTED]> wrote:

> I have 2 EJBs coded with XDoclet 1.2.3 and their
> deploy target is weblogic
> 8.1sp2
>  TransactionLogBean - BMP bean, everything works
> fine, including @
> weblogic.transaction-isolation tag;
> SSBFacadeBean - a Stateless Session bean. I got 2
> troubles.
>  1) If I set @ejb.transaction tag to class-level, it
> doesn't work. So I have
> to set it method-level as a workaround.
> 2) Whatever I tried with
> @weblogic.transaction-isolation tag. xdoclet
> ignores the setting - TRANSACTION_READ_COMMITTED ,
> generated
> weblogic-ejb-jar.xml has an empty <isolation-level>
> block. Of course,
> weblogic.ejbc complains about it.
>  Thanks in advance!
> 
> <transaction-isolation>
> 
> <isolation-level></isolation-level>
> 
> <method>
> <description><![CDATA[]]></description>
> <ejb-name>SSBFacade</ejb-name>
> <method-intf>Remote</method-intf>
> <method-name>loadAll</method-name>
> <method-params>
> </method-params>
> </method>
> </transaction-isolation>
>  The code snippet is as below
> 
> import java.util.ArrayList;
> import java.util.Collection;
> import java.util.Iterator;
> 
> /**
> * @ejb.bean
> * type="Stateless"
> * name="SSBFacade"
> * jndi-name="ejb/SSBFacade"
> * transaction-type="Container"
> *
> * @weblogic.transaction-isolation
> TRANSACTION_READ_COMMITTED
> */
> 
> /**
> * make sure method call is in a transaction context
> */
> public class SSBFacadeBean implements SessionBean {
> 
> private static final String SELECT_ALL_SQL = "SELECT
> account_id,
> holder_name, balance FROM UserAccount";
> private static final String SELECT_SQL = "SELECT
> account_id, holder_name,
> balance FROM UserAccount WHERE account_id = ?";
> private static final String dsName = "oracleDS";
> 
> 
> /**
> * @ejb.interface-method
> * view-type="remote"
> * @ejb.transaction
> * type="Required"
> * @weblogic.transaction-isolation
> TRANSACTION_READ_COMMITTED
> */
> public Collection loadAll() {
> log("loadAll()...");
> Connection conn = null;
> PreparedStatement ps = null;
> ResultSet rs = null;
> try {
> 
> ArrayList result = new ArrayList();
> 


                
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

Attachment: weblogic-ejb-jar-xml.xdt
Description: 2446731076-weblogic-ejb-jar-xml.xdt

Reply via email to