mirror of
https://github.com/corda/corda.git
synced 2025-01-14 16:59:52 +00:00
The column 'uploader' was marked as not updatable entity so any update wasn't propagated to the database when the attachment was uploaded again and the uploader field was changed to a trusted one. Also 'saveOrUpdate' removed, the entity is already managed, saveOrUpdate is for detached/new entity.
(cherry picked from commit 9f4c8bcea5
)
This commit is contained in:
parent
2bc1e73833
commit
3384470f6b
@ -96,7 +96,7 @@ class NodeAttachmentService(
|
||||
@Column(name = "insertion_date", nullable = false, updatable = false)
|
||||
var insertionDate: Instant = Instant.now(),
|
||||
|
||||
@Column(name = "uploader", updatable = false, nullable = true)
|
||||
@Column(name = "uploader", nullable = true)
|
||||
var uploader: String? = null,
|
||||
|
||||
@Column(name = "filename", updatable = false, nullable = true)
|
||||
@ -381,7 +381,6 @@ class NodeAttachmentService(
|
||||
if (attachment.uploader != uploader) {
|
||||
verifyVersionUniquenessForSignedAttachments(contractClassNames, attachment.version, attachment.signers)
|
||||
attachment.uploader = uploader
|
||||
session.saveOrUpdate(attachment)
|
||||
log.info("Updated attachment $id with uploader $uploader")
|
||||
contractClassNames.forEach { contractsCache.invalidate(it) }
|
||||
loadAttachmentContent(id)?.let { attachmentAndContent ->
|
||||
|
Loading…
Reference in New Issue
Block a user