ODB 2 JDO enhancement

#1

If I label a class @PersistenceCapable do I still need to explicitly enhance? Do I need a package.jdo file?

This question relates to experiences with ODB 1, in which one has to:

a) create a package.jdo, and

b) run the Enhancer

In my experience, using this with Tomcat, and running the enhancer in the contextListener class, there would often be errors relating to 'class not persistent capable'. So, in ODB 2 is there a way to mark a class as @PersistentCapable, and then let ODB take care of enhancement automatically?

Alternatively, is there a best practice for enhancement in a web environment.

(and in a dev environment using JRebel)?

#2

Annotations (@PersistenceCapable / @Entity) replace the XML metadata (e.g. package.jdo).

Enhancement is another issue. ObjectDB 2 can do almost everything without enhancement (all JPA operations and almost all JDO operations). But enhanced classes are faster - see  here.

You can use all the three enhancement methods (as explained on that page) also with a web application.

 

ObjectDB Support

Reply