I just got the OpenEntityManagerInViewFilter to work (in Eclipse, have not 
deployed yet ) after having struggled for several days. 

Do you use the EMF class from 
http://code.google.com/intl/sv-SE/appengine/docs/java/datastore/jpa/overview.html
 
? If so, that might cause your problem since it creates an 
EntityManagerFactory. 

I have modified EMF to:

public final class EMF {
    
    private static EMF _instance;
    
    private static EntityManagerFactoryInfo emfInstance;

    private EMF() {
        
        Object o = SpringApplicationContext.getBean("entityManagerFactory");
        emfInstance = (EntityManagerFactoryInfo)o;
    }

    public static EntityManagerFactory get() {
        if (_instance == null) {
            _instance = new EMF();
        }
        return emfInstance.getNativeEntityManagerFactory();
    }
    
}


where SpringApplicationContext is implemented as specified here: 
http://sujitpal.blogspot.com/2007/03/accessing-spring-beans-from-legacy-code.html
 
.

You still need the .size() hack after using getResultList().

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/mrOKBfoM2n4J.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to