ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James, Steven" <steven.ja...@logicacmg.com>
Subject RE: rollback
Date Fri, 16 Sep 2005 11:45:35 GMT
You don't need to. The end Transaction knows that commit has not been reached as the exception
will prevent that codes execution and jump to the exception handler then the finally block.
This end Transaction will just always rollback... On a successful transaction the rollback
will have no effect.. If you are not sure about what happens then just download the code all
the answers are there. I find this very useful you can then debug section if you wish to see
what is happening...
 
Steve..

________________________________

From: dionisio@tinieblas.com [mailto:dionisio@tinieblas.com]
Sent: Fri 16/09/2005 12:53
To: user-java@ibatis.apache.org
Subject: rollback



I needd one aclaration, i am confused.

i have this.
public void insertar(String statementName, Object parameterObject){
try{
    daoManager.startTransaction();
    insert(statementName, parameterObject);
    insert(statementName, parameterObject);
    insert(statementName, parameterObject);
    insert(statementName, parameterObject);
    daoManager.commitTransaction();
}catch(Exception e){

}finally{
        daoManager.endTransaction();
}
}
i start transaction and commit it if there is not exception
but if there is one exception into one insert the systems makes one roolback?
example if into the 3. insert there is one exception the 2 and 1 insert
rolls back?
or how can i say to rollback?

thanks






This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

Mime
View raw message