Skip to content

Instantly share code, notes, and snippets.

@alanhay
Created March 13, 2014 18:51
Show Gist options
  • Select an option

  • Save alanhay/9534438 to your computer and use it in GitHub Desktop.

Select an option

Save alanhay/9534438 to your computer and use it in GitHub Desktop.
OpenJPA Unsupported Runtime Unenhanced.
Hi John,
Good detective work with the Google searching. It sounds like you hit a
classic problem with the RuntimeUnenhancedClasses support. If the OneToMany
is not loaded immediately (ie. EAGER), there was no hook in place to cause
the loading at a later time.
But, if you are using one of the Enhancement mechanisms [1], then you should
not see this problem. If you interrogate the A entity instance via a
debugger, then the LAZY configured "bs" should be null. But, once you call
getBs(), then OpenJPA should be loading that collection.
My guess is that although you have verified that the build-time enhancement
is actually doing some work (due to the larger class size), you may actually
be running against non-enhanced entities. Just a guess.
What version of OpenJPA are running with? In the OpenJPA 2.0 code base, we
have actually disabled this RuntimeUnenhancedClasses by default due to the
unexpected processing that occurs with this type of enhancement.
If you are running with an older version of OpenJPA, then I would suggest
using this property. This will ensure that OpenJPA does not fall back to
this UnenhancedClasses sub-classing support. So, if you have a problem with
the proper build-time or run-time enhancement processing, you'll get flagged
and an error message will be posted.
<property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment