* Align startDBProcess with startProcess transaction semantic

This commit is contained in:
Heng Sin Low 2007-01-29 11:52:00 +00:00
parent 559c45aeb4
commit 85ddbcd144
1 changed files with 13 additions and 0 deletions

View File

@ -597,16 +597,29 @@ public class ServerBean implements SessionBean
public ProcessInfo dbProcess(ProcessInfo processInfo, String procedureName, String trxName)
{
String sql = "{call " + procedureName + "(?)}";
Trx trx = null;
if (trxName != null)
trx = Trx.get(trxName, true);
try
{
CallableStatement cstmt = DB.prepareCall(sql, ResultSet.CONCUR_UPDATABLE, trxName);
cstmt.setInt(1, processInfo.getAD_PInstance_ID());
cstmt.executeUpdate();
cstmt.close();
if (trx != null && trx.isActive())
{
trx.commit(true);
trx.close();
}
}
catch (Exception e)
{
log.log(Level.SEVERE, sql, e);
if (trx != null && trx.isActive())
{
trx.rollback();
trx.close();
}
processInfo.setSummary (Msg.getMsg(Env.getCtx(), "ProcessRunError") + " " + e.getLocalizedMessage());
processInfo.setError (true);
}