Announcement Announcement Module
Collapse
No announcement yet.
BATCH_JOB_PARAMS: weird DATE_VAL value Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BATCH_JOB_PARAMS: weird DATE_VAL value

    Hi

    I am calling a batch job with this parameters:
    Code:
    P03Test-context.xml  p03job nombre.archivo=classpath:input/P030517C.057 id.ejecucion=243 archivo.tipo=P03 ifi=001 anio=2008 mes=06 dia=00 numero.cinta=420322 fecha.ejecucion=26/09/2008
    And this is how they are stored in BATCH_JOB_PARAMS table:

    Code:
     JOB_INSTANCE_ID     TYPE_CD     KEY_NAME         STRING_VAL                    DATE_VAL             LONG_VAL     DOUBLE_VAL    
     ------------------  ----------  ---------------  ----------------------------  -------------------  -----------  ------------- 
     1                   STRING      anio             2008                          31/12/1969 21:00:00  0            0             
     1                   STRING      numero.cinta     420322                        31/12/1969 21:00:00  0            0             
     1                   STRING      nombre.archivo   classpath:input/P030517C.057  31/12/1969 21:00:00  0            0             
     1                   STRING      mes              06                            31/12/1969 21:00:00  0            0             
     1                   STRING      archivo.tipo     P03                           31/12/1969 21:00:00  0            0             
     1                   STRING      ifi              001                           31/12/1969 21:00:00  0            0             
     1                   STRING      id.ejecucion     243                           31/12/1969 21:00:00  0            0             
     1                   STRING      fecha.ejecucion  26/09/2008                    31/12/1969 21:00:00  0            0             
     1                   STRING      dia              00                            31/12/1969 21:00:00  0            0

    So the question is, why is it storing 31/12/1969 on DATE_VAL and the second question is what are DATE_VAL, LONG_VAL and DOUBLE_VAL for if it always saves the values on the STRING_VAL column (or how should I pass the parameters to be recognized as date or long)?

    By the way, I am using 1.1.2

    thanks

  • #2
    You have to tell the job runner what type the parameters are, since they all kind as a string. The documentation for the runner gives more detailed example, but just add (long) or (date) at the end of the key name.

    Comment


    • #3
      As for the issue of the values being pumped in for the other fields, this is a Java default value issue - if you look at the long and decimal values they are defaulted to zero even though you have a string value for that key. The date value you have there (if I remember correctly) is the default date value in Java when the Date constructor is called with no argument or an argument of zero (dates are calculated in seconds from 1/1/1970, adjusted for time zone this will go back to 12/31/1970 if you are west of GMT).

      You might submit a JIRA bug fix request to set these values to NULL instead of zero and to make the fields in the provided schemata NULLable.

      Comment

      Working...
      X