Results 1 to 2 of 2

Thread: job execution context is not saved properly

  1. #1
    Join Date
    Sep 2006
    Location
    Work in New York City
    Posts
    127

    Default job execution context is not saved properly

    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

    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 ....
    }
    The field with the problem is funderABA.

    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 )

    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}]}}}}}
    You will notice that the value of the funderABA field does not have the leading zero.
    I'm using spring batch 2.0.4.
    Last edited by RobertGloverJr; Feb 2nd, 2010 at 03:23 PM. Reason: add version number of spring batch being used
    Java Developer with all the usual Sun Java certifications.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    That's a bug in Jettison. I think it might be fixed, so can you upgrade to 1.1 and see if it works?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •