Unlimited String Values Compare

1
Hi, I am trying to retrieve entity using a microflow which is having an Xpath constraint AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] Here the attributes NewValue and OldValue are of type string with unlimited length. I am getting the below error when i run the microflow. Note:- I am using Oracle Database as the backend. li: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: li: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at PurgeAuditLogHotFix.mfDeleteUnchangedAttributesBatch (Retrieve : 'Retrieve list of Log_Line from database') Advanced stacktrace: at PurgeAuditLogHotFix.mf_DeleteUnchangedAttributes (JavaAction : 'DeleteUnchangedAttributes') Advanced stacktrace: at mz.a(SourceFile:190) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: li: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at PurgeAuditLogHotFix.mfDeleteUnchangedAttributesBatch (Retrieve : 'Retrieve list of Log_Line from database') Advanced stacktrace: at com.mendix.core.Core.execute(SourceFile:232) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: li: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at PurgeAuditLogHotFix.mfDeleteUnchangedAttributesBatch (Retrieve : 'Retrieve list of Log_Line from database') Advanced stacktrace: at hG.b(SourceFile:217) Caused by: com.mendix.core.CoreException: li: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at PurgeAuditLogHotFix.mfDeleteUnchangedAttributesBatch (Retrieve : 'Retrieve list of Log_Line from database') Advanced stacktrace: at com.mendix.core.Core.execute(SourceFile:308) Caused by: li: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at PurgeAuditLogHotFix.mfDeleteUnchangedAttributesBatch (Retrieve : 'Retrieve list of Log_Line from database') Advanced stacktrace: at mz.a(SourceFile:190) Caused by: com.mendix.core.CoreRuntimeException: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at hG.b(SourceFile:217) Caused by: l: An exception has occurred for the following request(s): fw (depth = 0, amount = 10000): //AuditTrail.LogLine[AuditTrail.LogLineLog/AuditTrail.Log/LogType ='Change' and NewValue = OldValue] at x.a(SourceFile:49) Caused by: l: Exception occurred while retrieving data. (SQL State: 42000, Error Code: 932) at H.a(SourceFile:1394) Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got NCLOB at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) at H.a(SourceFile:313) at H.a(SourceFile:209) at H.a(SourceFile:159) at H.a(SourceFile:148) at z.a(SourceFile:41) at dA.a(SourceFile:192) at dA.a(SourceFile:150) at dA.a(SourceFile:83) at dE.a(SourceFile:68) at x.a(SourceFile:43) at h.a(SourceFile:269) at hy.b(SourceFile:130) at hy.a(SourceFile:70) at hu.a(SourceFile:63) at hu.executeAction(SourceFile:21) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hG.b(SourceFile:206) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:1156) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:1125) at lQ.b(SourceFile:130) at lQ.a(SourceFile:84) at mz.a(SourceFile:77) at my.a(SourceFile:155) at my.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hG.b(SourceFile:206) at com.mendix.core.Core.execute(SourceFile:304) at com.mendix.core.Core.execute(SourceFile:280) at purgeauditloghotfix.actions.DeleteUnchangedAttributes.DeleteLogLines(DeleteUnchangedAttributes.java:75) at purgeauditloghotfix.actions.DeleteUnchangedAttributes.executeAction(DeleteUnchangedAttributes.java:43) at purgeauditloghotfix.actions.DeleteUnchangedAttributes.executeAction(DeleteUnchangedAttributes.java:23) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hG.b(SourceFile:206) at com.mendix.core.Core.execute(SourceFile:226) at lp.a(SourceFile:69) at mz.a(SourceFile:77) at my.a(SourceFile:155) at my.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hG.b(SourceFile:206) at com.mendix.core.Core.execute(SourceFile:226) at gp.execute(SourceFile:186) at jf.a(SourceFile:321) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192) Please help. Thanks, Aravind
asked
4 answers
2

From what I could find you are not allowed to compare two CLOB in a statement with ORACLE as stated here. I'm not sure how to work around this issue in Mendix as you aren't able to change the statement to something like

WHERE to_char(TEST_SCRIPT) = 'something' AND ID = '10000239';

As with the to_char you would be alble to compare CLOB which are less then 4K.

answered
1

Hi Aravind,

What exactly are you trying to achieve in this microflow? It seems like you're trying to delete all audit log lines for unchanged attributes from the audit log. Did you know that there is a setting for this in the Audit trail module? You can configure this in the non persistent Configuration entity in the domain model of the module.

IncludeOnlyChangedAttributes [False]: Determines if the module should create a LogLine for every single Member every time it initiates the Audit, or should only the Changed Members be logged.

answered
0

Dears ,, I faced the same issue  and i solved it by o fix this issue try to convert the type from string(unlimited) to string(limited) 200,400,… ect. that used in the xpath

answered
0

in from mendix string unlimited to oracle will be NCLOB , and String with limited will be store in oracle as varchar2. In your error message, look like it compare 2 different value types.

answered