Menu

#47 Recompute for specific attributes Error

Needs More Info
open
nobody
None
0902
Max
recompute
normal
2013-01-21
2013-01-21
Sira Imatia
No

Hi,

We were testing "Recompute for specific attributes" with BusLogicDemo beans an we found and unusual behaviour.

We change the values in data base putting all Customer.balance = 0 and all Purchaseorder.amountTotal = 0. We send you the database script attached.

Then these values are wrong and we want to recalculate them using the following code:

public static void main(String[] args) throws IOException {
    EntityManagerFactory entityManagerFactory = 
        Persistence.createEntityManagerFactory("OntimizeLogicTesting");
    Set<String> entityNamesToCheck = new HashSet<String>();
    entityNamesToCheck.add("buslogicdemo.data.Purchaseorder:amountTotal");

    Configuration recomputeConfiguration = new Configuration();
    recomputeConfiguration.setEntityNamesToCheck(entityNamesToCheck);

    Engine engine = new Engine(recomputeConfiguration, entityManagerFactory);
    engine.fix();
    RecomputeResult resRR =  engine.getResult();
    System.out.println("Res recompute : "+resRR.getFixes());
}

Recompute fixes Purchaseorder.amountTotal, but it doesn't recalculate the Customer.balance. Even if we add the bean "Customer" to the Recompute configuration, the balance won't be recalculated:

public static void main(String[] args) throws IOException {
    EntityManagerFactory entityManagerFactory = 
        Persistence.createEntityManagerFactory("OntimizeLogicTesting");
    Set<String> entityNamesToCheck = new HashSet<String>();
    entityNamesToCheck.add("buslogicdemo.data.Purchaseorder:amountTotal");
    entityNamesToCheck.add("buslogicdemo.data.pojo.Customer");

    Configuration recomputeConfiguration = new Configuration();
    recomputeConfiguration.setEntityNamesToCheck(entityNamesToCheck);

    Engine engine = new Engine(recomputeConfiguration, entityManagerFactory);
    engine.fix();
    RecomputeResult resRR =  engine.getResult();
    System.out.println("Res recompute : "+resRR.getFixes());
}

We think Recompute must to recalculate both values: Purchaseorder.amountTotal and Customer.balance.

Is there anything wrong in the Recompute configuration or is there any error in the adjusted parents process?

Cheers,
Sira

1 Attachments

Discussion

Anonymous
Anonymous

Add attachments
Cancel