I am using Jboss 4.0.4 GA,JDK1.5.0_01. My database is informix. When I use JTA in Tomcat,it always failed,please help me,Thanks! My code is: String ls_sql=null; Context ctx=null; UserTransaction ut=null; Connection conn=null; Connection conn1=null; try{ ctx = new InitialContext(); ut=(UserTransaction)ctx.lookup("java:/comp/UserTransaction"); ut.begin();
DataSource ds = (DataSource) ctx.lookup"java:/comp/env/jdbc/szjdcdb"); ls_sql=" update y_user set username='yzs' where usercode='001'"; conn=ds.getConnection(); Statement stmt=conn.createStatement(); stmt.execute(ls_sql); stmt.close(); DataSource ds1 = (DataSource) ctx.lookup("java:/comp/env/jdbc/szxmgl"); ls_sql=" update y_user set username='yzs' where usercode='001'"; conn1=ds.getConnection(); Statement stmt1=conn.createStatement(); stmt1.execute(ls_sql); stmt1.close(); request.setAttribute("sql","ok"); ut.commit(); }catch(Exception e){ ut.rollback(); request.setAttribute("error",e.toString()); request.setAttribute("sql",ls_sql); return mapping.findForward("failed"); }finally{ conn.close(); conn1.close(); } Jboss didn't report errors,but table is locked,Why ? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952670#3952670 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952670 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user