openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilbertoca <gilbert...@gmail.com>
Subject Re: InvalidStateException
Date Fri, 14 May 2010 14:03:01 GMT


Rick Curtis wrote:
> 
> The message means that you don't have an active transaction to commit....
> :-) Is it possible that your getEntityManager() method call isn't
> returning
> the same em?
> 
> 

This one is my general apache click page[1] which my regular page classes
extends (like the LegalEntityPage ):


> public class BorderPage extends Page {
> 
>     /** The root menu. */
>     protected Menu rootMenu = Menu.getRootMenu();
>     //@PersistenceContext protected EntityManager em;
>     protected EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("parkPU");
> 
>     public BorderPage() {
>         addModel("title", "Main Page");
>     }
> 
>     /**
>      * Returns the name of the border template: &nbsp;
> <tt>"/border-template.htm"</tt>
>      *
>      * @see Page#getTemplate()
>      */
>     public String getTemplate() {
>         return "/border-template.htm";
>     }
> 
>     protected EntityManager getEntityManager() {
>         return emf.createEntityManager();
>     }
> }
> 

Is there anything wrong with this approach?

Regards,

Gilberto

[1]http://click.apache.org/docs/click-api/org/apache/click/Page.html
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051070.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message