DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCJPA-88
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: Jonathan Lawson
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
DataNucleus API JPA

@Version field present in @MappedSuperclass not incremented on update

Created: 22/Nov/10 10:49 PM   Updated: 08/Dec/10 03:28 PM   Resolved: 23/Nov/10 11:09 AM
Component/s: API
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Zip Archive Bug Report (3 kB)
2. Zip Archive (2 kB)

Environment: Google appengine Eclipse plugin 1.3.8 SDK under windows XP

 Description  « Hide
A field with an @Version annotation placed in a superclass annotated with @MappedSuperclass seems not to be updated on commit. The VERSION field looks like it is created but the version variable stays set at 0. If the code is untouched except that the field with the @Version annotation is moved into the @Entity subclass then it works as expected.

Sort Order: Ascending order - Click to sort in descending order
Jonathan Lawson added a comment - 22/Nov/10 11:58 PM - edited
Test case files.

This defines a servlet that demonstrates the problem. Also included is the output produced.

This should be everything needed to reproduce the problem.

Note that this test case is slightly complicated by defining two version fields for the case that works, but the result is more revealing like this.

Andy Jefferson added a comment - 23/Nov/10 07:11 AM
Please follow the DataNucleus problem testcase format, as linked on the front page of JIRA, in the docs, and the forum

Jonathan Lawson added a comment - 23/Nov/10 10:36 AM
Repackaged bug report according to standards.

Note that I tested this by invoking main from within a servlet in google appengine, since this is the only test environment I have. However the only dependency on this environment is the ConnectionURL in persistence.xml which is "appengine". This may need to be changed. I doubt the problem is provider dependent though.

Andy Jefferson added a comment - 23/Nov/10 11:09 AM
Since you say you're using GAE/J then you're using DN 1.1 (you didn't put a "Affected Version" on the report). This version hasn't been supported for more than a year. I ran your test with current codebase (against RDBMS) and I have no issue with version updating.

Refer to for GAE/J and our position.

Andy Jefferson added a comment - 23/Nov/10 11:32 AM