The problem I have is that the job execution context is not saved properly: I
have a class that has a String attribute; in my particular scenario the value
of that field is actually a number, but with a leading zero (021038831); when
saved to the batch_job_execution_context table the leading zero is lost;
that means that in case I need to restart the job it will be restarted with an
invalid context;
Here is the code for my class
The field with the problem is funderABA.Code:public class Obligation implements Serializable{ private static final long serialVersionUID = 3044514607425389560L; private long obligationId; private String funderABA; private Date recordDate; private Date paymentDate; private Date balanceDate; private Notification notification; private BigDecimal totalFundingAmount; private Collection<PayoutPattern> payoutPatterns = new ArrayList<PayoutPattern>(); .... snip .... public String getFunderABA() { return funderABA; } public void setFunderABA(String funderABA) { this.funderABA = funderABA; } .... snip .... }
And this is the value persisted in the short_context column of batch_job_execution_context.
(you will see the within the code below: "funderABA":21038831 )
You will notice that the value of the funderABA field does not have the leading zero.Code:{"map":{"entry":{"string":"Obligation","frb.ny.sec.pni.model.Obligation": {"obligationId":5339,"funderABA":21038831,"recordDate":{"@class":"sql- date","$":"2009-09-01"},"paymentDate":{"@class":"sql- date","$":"2009-09-25"},"balanceDate":{"@class":"sql- date","$":"2009-08-31"},"notification":{"notificationId":5339,"payoutDate": {"@class":"sql-date","$":"2009-09-25"},"reportDate":{"@class":"sql- date","$":"2009-09-18"}},"totalFundingAmount":1.207551898606E10,"payoutP atterns":{"@class":"list","frb.ny.sec.pni.model.PayoutPattern": [{"incrementNo":1,"percentage":30},{"incrementNo":2,"percentage":30}, {"incrementNo":3,"percentage":40}]}}}}}
I'm using spring batch 2.0.4.



Reply With Quote