Issue while appending the child concepts ExtId

Issue while appending the child concepts ExtId

book

Article ID: KB0084288

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -

Description

The following exception is seen when trying to execute the Database.queryUsingPreparedStmt to load data into the DBConcept. The function queryUsingPreparedStmt loads the parent and the child concepts and this issue occurres when building the child's ExtId. The following two primary key combinations are being treated as the same ExtId.

Example,
The Parent (D_DSDV) concept with the child (D_DV) containing DEPT:50 VENDOR_NBR:38 and DEPT:503 VENDOR_NBR:8

1000002087<>50<>38 and 000002087<>503<>8 are being treated the same.

Error Logs :
2017 Feb 07 13:20:00:792 GMT -6 10.97.24.101 Error [main] - [runtime.service] [inference-class] Got runtime exception while invoking Action com.tibco.cep.runtime.session.impl.RuleFunctionsExecAction@6c9bf3b5 Objects <>
java.lang.RuntimeException: com.tibco.cep.runtime.model.element.ContainedConceptException: Attempted to set Instance be.gen.DatabaseConcepts.VIJAY.D_DSDV@id=3@extId=D_DSDV:1.000002087E9&v=0 as the parent of Instance be.gen.DatabaseConcepts.VIJAY.D_DV@id=4@extId=D_DV:1.000002087E9:50:38&v=0 while it has been set to Instance be.gen.DatabaseConcepts.VIJAY.D_DSDV@id=3@extId=D_DSDV:1.000002087E9&v=0
at com.tibco.cep.modules.db.functions.JDBCHelper.queryUsingPreparedStmt(SourceFile:727)
at be.gen.RuleFunctions.DBOps.ObjectgetAllDSDV$.getAllDSDV(ObjectgetAllDSDV$.java:17)
at be.gen.RuleFunctions.nullStartup$.Startup(nullStartup$.java:15)
at be.gen.RuleFunctions.Startup.invoke(Startup.java:11)
at com.tibco.cep.runtime.session.impl.RuleFunctionsExecAction.executeComponent(RuleFunctionsExecAction.java:65)
at com.tibco.cep.kernel.core.rete.ReteWM$2.doTxnWork(SourceFile:486)
at com.tibco.cep.kernel.core.rete.BeTransaction.run(SourceFile:156)
at com.tibco.cep.kernel.core.rete.BeTransaction.execute(SourceFile:101)
at com.tibco.cep.kernel.core.rete.ReteWM.invoke(SourceFile:536)
at com.tibco.cep.kernel.core.rete.ReteWM.start(SourceFile:190)
at com.tibco.cep.runtime.session.impl.RuleSessionImpl.start(RuleSessionImpl.java:384)
at com.tibco.cep.runtime.session.impl.RuleSessionManagerImpl.start(RuleSessionManagerImpl.java:251)
at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.startAll(RuleServiceProviderImpl.java:1132)
at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.configure(RuleServiceProviderImpl.java:254)
at com.tibco.cep.container.standalone.BEMain.jumpStart(SourceFile:170)
at com.tibco.cep.container.standalone.BEMain.main(SourceFile:71)
Caused by: com.tibco.cep.runtime.model.element.ContainedConceptException: Attempted to set Instance be.gen.DatabaseConcepts.VIJAY.D_DSDV@id=3@extId=D_DSDV:1.000002087E9&v=0 as the parent of Instance be.gen.DatabaseConcepts.VIJAY.D_DV@id=4@extId=D_DV:1.000002087E9:50:38&v=0 while it has been set to Instance be.gen.DatabaseConcepts.VIJAY.D_DSDV@id=3@extId=D_DSDV:1.000002087E9&v=0
at com.tibco.cep.runtime.model.element.impl.ConceptImpl.setParent(ConceptImpl.java:933)
at com.tibco.cep.runtime.model.element.impl.property.simple.PropertyAtomContainedConceptSimple.<init>(PropertyAtomContainedConceptSimple.java:42)
at com.tibco.cep.runtime.model.element.impl.property.simple.PropertyArrayContainedConceptSimple.addToEnd(PropertyArrayContainedConceptSimple.java:59)
at com.tibco.cep.runtime.model.element.impl.property.simple.PropertyArrayContainedConceptSimple.add(PropertyArrayContainedConceptSimple.java:71)
at com.tibco.cep.runtime.model.element.impl.property.simple.PropertyArrayContainedConceptSimple.add(PropertyArrayContainedConceptSimple.java:48)
at com.tibco.cep.modules.db.functions.QueryHelper.a(SourceFile:241)
at com.tibco.cep.modules.db.functions.QueryHelper.a(SourceFile:70)
at com.tibco.cep.modules.db.functions.JDBCHelper.queryUsingPreparedStmt(SourceFile:724)
... 15 more

Issue/Introduction

Concept ExtIDs 1000002087:50:38 and 000002087:503:8 are being treated the same.

Environment

BusinessEvents 5.x All Operating Systems

Resolution

Even though the extId is uniquely generated, internally when we query children, we calculate the keys based on the primary keys for that table. In case of multiple columns within the primary key, we append them, so for child table both of the following entries end up having the same value,
 
10000020875038
10000020875038

Workaround :
Change one of the values or auto incremental the column to the primary key.

Permanent Fix:
BE Engineering confirmed the reported issue is a bug and BE defect (BE-24841) and will be fixed in BE 5.3.0 HF3


 

Additional Information

BE Engineering