Description
This problem was originally reported on the users mailing list by Diego Cattelan. Link to the thread :http://openjpa.208410.n2.nabble.com/N-query-problem-with-Version-td6027619.html
The problem occurs if a null value is returned for an entity's version field. In this case OpenJPA will issue a second select statement to re-fetch the version, potentially resulting in a lot of repetitive SQL statements.