* Align startDBProcess with startProcess transaction semantic
This commit is contained in:
parent
559c45aeb4
commit
85ddbcd144
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue