Simple Question I have a standalone client calling a stateless session bean with container managed transaction. In the bean I have 2 database inserts in a method to SQL 2000 database. The second insert is for a table that does not exists so as per my understanding the transaction should be rolled back and neither of the updates should take place. What I am finding is the first insert takes place even though the second insert is throwing an error!! PLS HELP!!! Below is my EJB code. public class TranTestEJB implements SessionBean { SessionContext ctx; public void ejbActivate() {} public void ejbPassivate() {} public void ejbCreate() {} public void ejbRemove() {} public void setSessionContext(SessionContext ctx) { this.ctx = ctx; } public void runTest() { String url = "jdbc
dbc:Queue"; String user = "sa"; String password = ""; String sql; String sql2; Connection connection; Statement statement; try{ //ctx.getUserTransaction().begin(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); connection = DriverManager.getConnection(url,user,password); statement = connection.createStatement(); sql = "Insert into Description values ('HA')"; statement.executeUpdate(sql); sql2 = "Insert into AAAXXX values ('HB')"; statement.executeUpdate(sql2); ().commit(); } catch (Exception e) { throw new EJBException(e.getMessage); } finally { sql = null; sql2 = null; statement = null; connection = null; } } } My deployment descriptor has the following code <ejb-jar> <enterprise-beans> <session> <ejb-name>TranTest</ejb-name> <home>test.TranTestHome</home> <remote>test.TranTest</remote> <ejb-class>test.TranTestEJB</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>TranTest</ejb-name> <method-name>*</method-name> </method> <trans-attribute>RequiresNew</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> PLS Help.