Here is where I try to store it and check if it is done:
public void modificarFechaPasadaErrpedi(String horaAhora){
comprobConfigDB.setFechaErrPediDB(horaAhora);
if(comprobConfigDB.getFechaErrPediDB().compareTo(horaAhora) == 0 ){
System.out.println("Fecha base de datos guardada " + horaAhora);
} else {
System.out.println("Fecha base de datos no guardada " + horaAhora);
}
}
We normally define @Property annotation on the getter only. The setter is found automatically by its name. Please try to remove it from setter, and check the saving again.
Please check if the new value is saved by using App Properties screen or ConfigStorage JMX bean. When you check in the same service method that modifies the property, it may depend on how you use transactions in your service. The setProperty method works in the same transaction as the calling code (if there is an active transaction), while the getProperty method reads the properties cache always in a new transaction, so it may not see the changes.
Now it is working perfectly in my local server, but in production server setProperty is storing property well and getProperty is reading sometimes the last value saved before actual value