-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Limited to using long for entity ids #1317
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
Comments
Rob Fletcher commented OK. Delving deeper into the codebase I can see that JSR-352 is built around |
Dave Syer commented We should maybe work in this together a bit. I think that the JobRepository was basically designed to need a global lock when creating a new JobExecution, so the ids for that entity should be centrally generated anyway (it's a common problem and I'm sure we can find a solution). The natural key for all the other entities is actually the job execution id and a local identifier, so my instinct is that there should be a repository implementation that doesn't care how global the latter are. As long as you don't need to start loads of really small jobs it should work. |
The impediment due to the JSR is removed as of v5 (#3894). As mentioned by D.Syer, IDs should be generated centrally to prevent creating duplicate job executions. However, they do not have to be of type
Now since the creation of job executions should be done centrally anyway, I think the ordering could be based on creation time. -- Related issue: #877 |
Rob Fletcher opened BATCH-2254 and commented
We're attempting to build a workflow orchestration system and Spring Batch – primarily using Tasklets – seemed a good fit but one of the things we need to do is persist job status to a clustered environment (cross-region on Amazon's cloud) in order that we can recover from instance outages, even region outages and have job execution continue. The fact that Spring Batch's
Entity
class makes it impossible to use any id type other than long is preventing us from using a clustered storage solution such as Cassandra. We'd have to introduce some kind of blocking in order to reliably generate a unique long id without danger of collision. It seems like it would make sense ifEntity
usedSerializable
as a key which wouldn't preclude the current strategy for non-clustered SQL stores but would open a path to using UUIDs.Affects: 3.0.1
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: