-
Notifications
You must be signed in to change notification settings - Fork 872
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
link to ODocument saved properly and later corrupted [related to #2411] #2660
Comments
FYI. The issue does not occur with a DB from memory. |
Just wanted to add to this bug, to help identify the core issue. Just a warning - I am no expert of Orient, but I was debugging to help out. I am not sure what is known, and may not use the proper terminology, but I think I can show that the server is definitely corrupted on the return after the query. With the Code provided by the OP, the "data" is misrepresented only after the OSQLSynchQuery, and then continues to be incorrect, thus "corrupted". so above, the DB load will return the objects with the proper rids
"emergency_contact":[{"relationship":"brother","contact":"#11:112"}]} However after the SQL Query (and other database commands).
the output is then - the inner #11:112 is lost. "emergency_contact":[{"relationship":"brother","contact":{"@type":"d","@Version":0,"@Class":"PersonTest","name":"jaime"}}]} Now at first I thought it was just a marshalling issue, but a DB load AFTER the SQL call will now return the same thing as the query. The DB Load _has changed_. So... I started to debug the query code which brought me to OChannelBinaryProtocol, line 124.
the "network" is where the retrieved record comes back from the server in byte code. Line at record.fill is where the returned record of "tyrion" is filled in, including our "emergencyContact". Unfortunately by that time, the our "inner" object rid is lost.
|
When laa worked on #2411, he was under the impression that my JSON was incorrect. However, it was my intent to leave out a document type because the emergency contact is not meant to be a document but a field of a document that includes a "link" to a second document. It appears that in OrientDB 1.7.7, the nested link is initially stored properly and later corrupted by subsequent db activity.
I have provided code below that illustrates my issue. Initially, the nested link to a document is saved properly, however, the query returns a corrupted version of the document. The corrupted version no longer includes the link but has some but not all of the values of the document having the rid. Most importantly, the rid value has disappeared.
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import java.util.List;
class InnerDoc {
}
The text was updated successfully, but these errors were encountered: