IDEMPIERE-2756 Background threads losing context when user log out
This commit is contained in:
parent
45ce71ef48
commit
d726d9c75a
|
@ -1989,6 +1989,7 @@ public abstract class PO
|
||||||
*/
|
*/
|
||||||
public boolean save()
|
public boolean save()
|
||||||
{
|
{
|
||||||
|
checkValidContext();
|
||||||
CLogger.resetLast();
|
CLogger.resetLast();
|
||||||
boolean newRecord = is_new(); // save locally as load resets
|
boolean newRecord = is_new(); // save locally as load resets
|
||||||
if (!newRecord && !is_Changed())
|
if (!newRecord && !is_Changed())
|
||||||
|
@ -3107,6 +3108,7 @@ public abstract class PO
|
||||||
*/
|
*/
|
||||||
public boolean delete (boolean force)
|
public boolean delete (boolean force)
|
||||||
{
|
{
|
||||||
|
checkValidContext();
|
||||||
CLogger.resetLast();
|
CLogger.resetLast();
|
||||||
if (is_new())
|
if (is_new())
|
||||||
return true;
|
return true;
|
||||||
|
@ -4670,4 +4672,10 @@ public abstract class PO
|
||||||
log.saveError(msg, info);
|
log.saveError(msg, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkValidContext() {
|
||||||
|
if (getCtx().size() == 0)
|
||||||
|
throw new AdempiereException("Context lost");
|
||||||
|
}
|
||||||
|
|
||||||
} // PO
|
} // PO
|
||||||
|
|
Loading…
Reference in New Issue