01.JAVA/Java2009. 2. 23. 14:40
반응형
http://java.sun.com/developer/EJTechTips/2005/tt0125.html#1






   try {           
        Connection con = makeDatabaseConnection();
        con.setAutoCommit(false);          
        //  Do whatever database transaction functionality
        //  is necessary          
        con.commit();         
    } catch (Exception ex) {
        try {
            con.rollback();
        } catch (SQLException sqx) {
            throw new EJBException("Rollback failed: " +
                sqx.getMessage());
        }
    } finally {
        releaseDatabaseConnection();
    }
Posted by 1010