Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
6d52c15c
Unverified
Commit
6d52c15c
authored
4 years ago
by
Daniel
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Reference correct version.
If not-to-be-changed entities are in container.
parent
d5d9a714
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/caosdb/server/jobs/Job.java
+13
-11
13 additions, 11 deletions
src/main/java/caosdb/server/jobs/Job.java
with
13 additions
and
11 deletions
src/main/java/caosdb/server/jobs/Job.java
+
13
−
11
View file @
6d52c15c
...
@@ -188,17 +188,19 @@ public abstract class Job extends AbstractObservable implements Observer {
...
@@ -188,17 +188,19 @@ public abstract class Job extends AbstractObservable implements Observer {
if
(
ret
!=
null
)
{
if
(
ret
!=
null
)
{
return
ret
;
return
ret
;
}
}
}
else
if
(
version
.
startsWith
(
"HEAD~"
)
&&
getEntityById
(
id
)
!=
null
)
{
}
else
if
(
version
.
startsWith
(
"HEAD~"
))
{
// if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is
EntityInterface
entById
=
getEntityById
(
id
);
// part of this request (i.e. is to be updated), the actual offset has to be
if
(
entById
!=
null
&&
entById
.
getEntityStatus
()
!=
EntityStatus
.
VALID
)
{
// reduced by 1. HEAD always denotes the entity@HEAD *after* the successful
// if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is is to be
// transaction.
// updated, the actual offset has to be reduced by 1. HEAD always denotes the entity@HEAD
int
offset
=
Integer
.
parseInt
(
version
.
substring
(
5
))
-
1
;
// *after* the successful transaction, so that it is consistent with subsequent retrieves.
if
(
offset
==
0
)
{
int
offset
=
Integer
.
parseInt
(
version
.
substring
(
5
))
-
1
;
// special case HEAD~1
if
(
offset
==
0
)
{
resulting_version
=
"HEAD"
;
// special case HEAD~1
}
else
{
resulting_version
=
"HEAD"
;
resulting_version
=
new
StringBuilder
().
append
(
"HEAD~"
).
append
(
offset
).
toString
();
}
else
{
resulting_version
=
new
StringBuilder
().
append
(
"HEAD~"
).
append
(
offset
).
toString
();
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment