| Summary: | [Hibernate] Mappings with version column are fragile | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Aleksander Bandelj <aleksander.bandelj> |
| Component: | cdo.core | Assignee: | Martin Taal <mtaal> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mtaal, stepper |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Aleksander Bandelj
I've discovered that CDO/Teneo adds always_version if not present. So, example model (and every model) is versioned. Actually, proper working of CDO/Teneo depends on versioning being present, as I discovered in HibernateStoreAccessor#write:
// first decrease the version for all dirty objects
// hibernate will increase it again
for (CDORevision revision : context.getDirtyObjects())
{
if (revision instanceof InternalCDORevision)
{
InternalCDORevision internalRevision = (InternalCDORevision)revision;
internalRevision.setVersion(internalRevision.getVersion() - 1);
}
}
So, I'm closing this bug.
Re-opening the issue as it warrants some more study (and an update of the wiki). gr. Martin For the time being, I would put two notes in the CDO/Teneo store wiki: - annotated version attribute in ecore model seems to break things - always_version is set for you (if not set explicity) and you should never it to false Remark from Eike in the newsgroup: I'm not so sure whether modeled version attributes are a good idea. How can we ensure that their values are confirming to CDO's interpretation? And if you want to exclude certain things (like modeled versions) I think it's better to write code that enforces the rule, not just docs ;-) gr. Martin Aleksander can you change the description to use the prefix: [Hibernate]? Then it will show up in the right list for me. gr. Martin ;-) ha the edit link next to the description, sometimes live is soooo simple (only if I would see it) :-) Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems. Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!! Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master. Modeled version attributes are not supported in the CDO Hibernate Store. I pushed several changes to let optimistic locking work correctly using the CDO version number. This is available in the next build. Mass update. Don't worry if this bug is already closed! |