Search code examples
neo4jspring-data-neo4j-4neo4j-ogm

Neo4j - Relaunch the program always revert the value of new added data


I have a problem with Neo4j database. When I add new Data to database and update the value of it (default : 0.0), it will recorded in database and then when I refresh the page, the data will not changed.

But, when I relaunch the program (Stop - Star or Restart) the program, the value of new Data will back to its original value (0.0). I already try to tracing all event that related to change the value, but none of the breakpoint is executed to change the value.

Is there any bug that can revert the value to its default value? Because the value of my new Data, same like the default value after I added it to database (Before update).

This is my simple code to create new data

LineItem newLineItem = new LineItem(engine, previousLineItem.getNo() + 1, previousLineItem.getSection(), "ACTIVITY ENGINE", previousLineItem.getActivityCode(), "ENGINE", 0.0,
    "",checked, "");
lineItems.add(newLineItem);
lineItemService.save(lineItems);

And this is how I updated my data

LineItem lineItem = lineItemService.findById(id);
if(lineItem != null){
    if(name != null)lineItem.setName(name);
    if(duration != null)lineItem.setDuration(roundUpToNearestQuarter(duration));
    lineItemService.save(lineItem);
    return lineItemList;
}
return new ArrayList<LineItem>();

The problem is, When I just refresh the page, and never Relaunch it, the duration data is same like the newest data, but after I relaunch the program, the duration data will revert back to default value (0.0)

There is no code that revert back my data to its original, because I already search global and give breakpoint on each code that have possibility to changed the value.


Solution

  • This bug related to my other bug, Argument mistype. Link : Spring Data Neo4j - Argument Type Mismatch

    It will revert all my values to default because when I relaunch the program, it will get the default data that I set before.

    Just need to check the attribute data and data saved on database, is it correct data or wrong type data.