Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODI + GROOVY + LOOP + COMMIT

inter1908Oct 21 2016 — edited Oct 25 2016

Hi all,

I have some concern about odi + groovy + loop + commit. If I put commit in the loop I don't see COMMIT but if I put COMMIT external for i see COMMIT.

In this example at end of script object are delete (commit done). Ad the end of script data is deleted-

txnDef = new DefaultTransactionDefinition();

tm = odiInstance.getTransactionManager();

txnStatus = tm.getTransaction(txnDef);

mgr = odiInstance.getTransactionalEntityManager();

for (int i = 0; i < allScenario.size(); i++)

{

  .....

  .....

    odiInstance.getTransactionalEntityManager().removeAll(allStepReport);   

    odiInstance.getTransactionalEntityManager().removeAll(allScenarioReport);   

}

odiInstance.getTransactionalEntityManager().persist(myProject);

tm.commit(txnStatus);

In this example at end of script objects aren't delete (commit not done). Ad the end of script data isn't deleted-

for (int i = 0; i < allScenario.size(); i++)

{

     txnDef = new DefaultTransactionDefinition();

     tm = odiInstance.getTransactionManager();

     txnStatus = tm.getTransaction(txnDef);

     mgr = odiInstance.getTransactionalEntityManager();

  .....

  .....

    odiInstance.getTransactionalEntityManager().removeAll(allStepReport);   

    odiInstance.getTransactionalEntityManager().removeAll(allScenarioReport);   

     odiInstance.getTransactionalEntityManager().persist(myProject);

     tm.commit(txnStatus);

}

Please can help me?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2016
Added on Oct 21 2016
2 comments
368 views