Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In JOB_PARAMS table DATE_VAL column is updated incorrectly Like "1/1/1970 1:00:00.000000 AM" instead to the current date. [BATCH-2015] #1577

Closed
spring-projects-issues opened this issue Apr 25, 2013 · 5 comments

Comments

@spring-projects-issues
Copy link
Collaborator

Sonali Singhal opened BATCH-2015 and commented


Affects: 2.1.8

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Lucas Ward commented

Sonali, Can you provide more details? What Database are you using? And at what version?

My gut reaction is that some databases will save 'epoch' rather than null. Unless somehow new Date(0) was saved as a parameter?

@spring-projects-issues
Copy link
Collaborator Author

Jimmy Praet commented

The job parameters are actually being persisted with these default values, even though the columns are nullable in the database:

DATE_VAL = new java.sql.Timestamp(0L)
STRING_VAL = ""
LONG_VAL = 0L
DOUBLE_VAL = 0D

See JdbcJobExecutionDao.insertParameter(Long, ParameterType, String, Object, boolean)

@spring-projects-issues
Copy link
Collaborator Author

Michael Minella commented

Just to confirm, the title of this issue states that you're expecting the current date. I'm thinking that it should be null instead of epoch when the parameter type is not a date. Is there a reason not to go this route?

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Jan 17, 2020

I agree with Michael, null is a better default value than the suggested current date or the start of epoch date (as implemented currently). I just checked all DDLs and they all declare the DATE_VAL column to be nullable by default. So changing new Timestamp(0L) with null in JdbcJobExecutionDao#insertParameter should be safe.

@parikshitdutta
Copy link
Contributor

Hi @benas, Please have a look at my submitted PR #3869, I will look forward to your feedback.

Thank you.

@fmbenhassine fmbenhassine modified the milestones: 5.0.0, 5.0.0-M1 Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants