Thanks for suggestion!
I gone through it.
I could very very new to
EJB's
I am sending you detail of code, if you can help me why it is not working !
"ejb-jar.xml"
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>SupplierDetailsEJB</ejb-name> <home>com.ejb.functionalmgr.supplierdetails.SupplierDetailsHome</home><remote>com.ejb.functionalmgr.supplierdetails.SupplierDetailsRemote</remote>
<ejb-class>com.ejb.functionalmgr.supplierdetails.SupplierDetailsBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>SupplierDetailsEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>SupplierDetailsEJB</ejb-name>
<method-name>updateSupplierDetails</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
"Bean Class"
public void updateSupplierDetails(SupplierDetailsVO supplierDetailsVO,
String currentRole) throws RemoteException, SQLException, SystemException {
Connection con = null;
try {
con = ConnectionPool.getConnection();
SupplierDetailsDAO supplierDetailsDAO = new SupplierDetailsDAOImpl();
supplierDetailsDAO.updateSupplierDetails(con, supplierDetailsVO, currentRole);
}
catch (SQLException e) {
throw new SQLException(e.getMessage());
}
catch (Exception e) {
throw new RemoteException(e.getMessage());
}
finally {
ConnectionPool.closeConnection(con);
}
}
supplierDetailsDAO.updateSupplierDetails(con, supplierDetailsVO, currentRole) methode having one update in one table, delete from another table and insertion in the same table depending upon certain criteria.
Now if any of above query fails (update delete insert), it is not rolling back fully.
Can you suggest me what wrong I am doing here!!!
Thanks
Shalindra Singh
SCJP, SCWCD