Change in ovirt-engine[master]: core : Network object serialization is missing the name fiel...

masayag at redhat.com masayag at redhat.com
Tue Dec 11 13:17:44 UTC 2012


Moti Asayag has submitted this change and it was merged.

Change subject: core : Network object serialization is missing the name field
......................................................................


core : Network object serialization is missing the name field

When deleting a Network and using compensation the Network entity is
being serialized to JSON using the jackson serializer and persisted into the
DB so this change can be rolled back in case of a failure/crash.

Using @JsonIgnore annotation on property when using jackson 1.9 and
above causes the field/field properties to be ignored by the jackson
serializer as mentioned on it's documentation:

"Before version 1.9, this annotation worked purely on method-by-method
(or field-by-field) basis; annotation on one method or field did not
imply ignoring other methods or fields. However, with version 1.9 and
above, annotations associated with various accessors (getter, setter,
field, constructor parameter) of a logical property are combined;
meaning that annotations in one (say, setter) can have effects on all of
them (if getter or field has nothing indicating otherwise)."

The @JsonIgnore annotation on getName() method causes the network
name to not be serialized - so in case of compensation on that entity
the executed SQL's doesn't contain the correct name value - which at the
moment causes  a constraint violation as network table has 'not null' constraint on
the 'name' column  which means that the whole compensation will roll back
and might leave the db in inconsistent state.

Change-Id: Ibf08e8b4cd99aa726885ee53f356edc22a6f4324
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Network.java
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Moti Asayag: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/9843
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf08e8b4cd99aa726885ee53f356edc22a6f4324
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>



More information about the Engine-commits mailing list