Hello Friends,
     I tried a very simple program of a client talking to a session bean.
The session bean consists of a inner java class whose transactions are to be
rolled back... The entity bean firstly successfully creates the inner class
and writes the data to d/b. Now there is an updation happening to the inner
table from the session bean which is written to the database but the
transaction is not commited. But before the business method of session bean
returns an exception is thrown from the session bean. Now ideally the
transaction should be rolled back. But its not happening. I have tried using
both the transactions from Session bean manually and also the container
prvided transactions. But to no avail. Can someone pl. tell me how to cause
a transaction to be rolled back. I am sending my ejb-jar.xml with this
mail...This is a simple problem of trying to rollback ..Anyhelp would be
highly appreciated..
I am sending both my session code and ejb-jar.xml file below..

Session Code:

  conn = ds.getConnection();

   pstmt = conn.prepareStatement(sql);
   int numrows = pstmt.executeUpdate();

   throw new Exception();



ejb-jar.xml file code :

<ejb-jar>
    <enterprise-beans>
      <session>
        <ejb-name>SessionCl</ejb-name>
 <home>pms.session.sess_cl.SessClHome</home>
 <remote>pms.session.sess_cl.SessClRem</remote>
 <ejb-class>pms.session.sess_cl.SessClBean</ejb-class>
 <session-type>Stateless</session-type>
 <transaction-type>Container</transaction-type>
       </session>
    </enterprise-beans>
    <assembly-descriptor>
      <container-transaction>
 <method>
   <ejb-name>SessionCl</ejb-name>
   <method-intf>Remote</method-intf>
   <method-name>*</method-name>
 </method>
 <trans-attribute>RequiresNew</trans-attribute>
      </container-transaction>
     </assembly-descriptor>
  </ejb-jar>
Regards,
Prateek.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to