1.) ok I switched to both newest version of ObjectDB and Spring Framework, however I still get error in Eclipse that points to pom.xml part (execution line):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>enhance</id>
<phase>process-classes</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.objectdb.Enhancer</mainClass>
<arguments>
<argument>guest.Guest</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
this is the error:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2:java (execution: enhance, phase: process-classes) pom.xml /mces line 88 Maven Project Build Lifecycle Mapping Problem
2.) What is more I often get an error that query is using a closed EntityManager although I use that @Autowired and @PersistenceContext automatic one like in the Spring MVC Tutorial GuestBook...
3.) I'm using Tomcat and I don't get the last part of the tutorial:
"To enable on the fly automatic enhancement (weaving) in Tomcat it has to be run with ObjectDB as a Java agent (javaagent:objectdb.jar). When using GlassFish - on the fly enhancement (weaving) is automatically enabled without specifying a Java agent."
P.S: I was using ObjectDB for some time but I used it the way that in Controllers I was initializating new class that I made DBconn():
public class DBconn {
private static String dbName = "mces_database.odb";
private EntityManager em;
public DBconn() {
em = Persistence
.createEntityManagerFactory(dbName).createEntityManager();
}
protected void finalize() {
em.close();
}
public EntityManager getEm() {
return em;
}
....
}
this is how I used to get em:
EntityManager em = (new DBconn()).getEm();
This worked somehow but sometimes on lists of my db objects I got 2 elements sometimes 7 elements and sometimes not full data when it should show 8 elements every time so I decided to search objectDB site to search for a solution and then I found that spring Tutorial which I've never seen before so I figured I should do it the way that it is in this Tutorial but now it is worse...