Workflow activity is not created intermittently

230 views
Skip to first unread message

Mohamad Iqbal

unread,
Jan 10, 2022, 11:30:09 PM1/10/22
to iDempiere
Hi Everyone,
In our system, the workflow activity is not created intermittently.

Here are the specifications of the server
idempiere : 8.2.0.202109250707
OS = WS 2019 Standrad
jdk = OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Here are the logs:
11:44:43.208===========> DefaultModelFactory.getPO: (id) - Table=AD_WF_Activity,Class=class org.compiere.wf.MWFActivity [2233]
java.lang.IllegalArgumentException: Cannot create new WF Activity directly
        at org.compiere.wf.MWFActivity.<init>(MWFActivity.java:153)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at org.adempiere.base.DefaultModelFactory.getPO(DefaultModelFactory.java:272)
        at org.compiere.model.MTable.getPO(MTable.java:528)
        at org.compiere.model.GridTable.dataSavePO(GridTable.java:2193)
        at org.compiere.model.GridTable.dataSave(GridTable.java:1616)
        at org.compiere.model.GridTab.dataSave(GridTab.java:1011)
        at org.adempiere.webui.adwindow.ADTabpanel.dataSave(ADTabpanel.java:1893)
        at org.adempiere.webui.adwindow.CompositeADTabbox.dataSave(CompositeADTabbox.java:942)
        at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave0(AbstractADWindowContent.java:2454)
        at org.adempiere.webui.adwindow.AbstractADWindowContent.onSaveCallback(AbstractADWindowContent.java:2447)
        at org.adempiere.webui.adwindow.AbstractADWindowContent$30.onCallback(AbstractADWindowContent.java:2390)
        at org.adempiere.webui.adwindow.AbstractADWindowContent$30.onCallback(AbstractADWindowContent.java:1)
        at org.adempiere.webui.adwindow.validator.WindowValidatorManager$ChainCallback.start(WindowValidatorManager.java:150)
        at org.adempiere.webui.adwindow.validator.WindowValidatorManager.fireWindowValidatorEvent(WindowValidatorManager.java:129)
        at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave(AbstractADWindowContent.java:2398)
        at org.adempiere.webui.adwindow.AbstractADWindowContent.onSave(AbstractADWindowContent.java:2331)
        at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
       
Has anyone experienced it? What is the cause?

Thank you for your help.

Regards,
Iqbal

Mohamad Iqbal

unread,
Feb 5, 2022, 1:07:02 AM2/5/22
to iDempiere
We are still facing this problem and when we are trying to debug, here are some another logs:

3:41:50.777===========> MWFProcess.startWork: AD_WF_Node_ID=181 [231]
org.adempiere.exceptions.AdempiereException: The database operation timed out. Please try again later.: GenerateDocumentNoTimeOut
....
caused by: org.postgresql.util.PSQLException: ERROR: canceling statement due to user request
  Where: while locking tuple (224,9) in relation "ad_sequence"; State=57014; ErrorCode=0

        

and this timed out is occured at MSequence class, method public static int getNextID (int AD_Client_ID, String TableName, String trxName).

if (DB.getDatabase().isQueryTimeoutSupported())
      {
        pstmt.setQueryTimeout(QUERY_TIME_OUT);
      }
      rs = pstmt.executeQuery();


and the query is:
SELECT s.CurrentNext, s.CurrentNextSys
FROM AD_Sequence s WHERE s.AD_Sequence_ID = 1003139 AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y'
ORDER BY s.AD_Client_ID DESC FOR UPDATE OF s


But when we redo the debug this error is not occurred. So this error is happen "intermittently".

Is there something related with postgre setting that can cause this locked or is three anything else?

Thank you for your help.

Regards,
Iqbal

Mohamad Iqbal

unread,
Feb 5, 2022, 1:13:31 AM2/5/22
to iDempiere
I forget to mention, we are also using nextid function (I believe this function already exist from Compiere) a lot in our background process, but when I look into it, there are no "FOR UPDATE" clause when selecting the sequence. Is this what cause the error?

Thank you. 

Martin Schönbeck

unread,
Feb 5, 2022, 6:35:48 AM2/5/22
to iDempiere
Hi Iqbal,

experiences like this often result from inconsistent usage of transactions. You should verify to use the same transaction overall and if using an explicit transaction then make sure to not forget it anywhere.

Regards,
Martin

Mohamad Iqbal

unread,
Feb 5, 2022, 8:33:23 PM2/5/22
to iDempiere
Hi Martin, 

Thank you for your kind reply. We will recheck our code again.

David Marquez

unread,
Nov 1, 2023, 12:15:16 PM11/1/23
to iDempiere
Hi Iqbal,

Do you have found any solution?

Regard, David.
Reply all
Reply to author
Forward
0 new messages