Re: [appengine-java] Re: Persistence with JPA + GAE

2010-02-10 Thread Diego Osse Fernandes
Hi Johan, try this code try{ cn2.getTransaction().begin(); cn2.persist(e); cn2.getTransaction().commit(); response.getWriter().write(ok); } catch(Exception e){ cn2.getTransaction().rollback();

Re: [appengine-java] Re: Persistence with JPA + GAE

2010-02-09 Thread Johan Vallejo
Hi Jake, Now i have this error Log : javax.persistence.PersistenceException: Transaction is still active. You should always close your transactions correctly using commit() or rollback(). this is my code : EntityManager cn2 = emf.get().createEntityManager(); distritos dist2 =

[appengine-java] Re: Persistence with JPA + GAE

2010-02-09 Thread Jake
Hey, I don't play with JPA too much, but I saw this: http://www.datanucleus.org/products/datanucleus/jpa/transactions.html Jake On Feb 9, 10:55 am, Johan Vallejo jvall...@vnperu.com wrote: Hi Jake, Now i have this error Log :javax.persistence.PersistenceException: Transaction is still

Re: [appengine-java] Re: Persistence with JPA + GAE

2010-02-09 Thread Diego Osse Fernandes
Hi Johan, you can use the Long as PK @Id @GeneratedValue(strategy = GenerationType.IDENTITY) Long id; []'s Diego 2010/2/9 Johan Vallejo jvall...@vnperu.com Hi Jake, Now i have this error Log : javax.persistence.PersistenceException: Transaction is still active. You

Re: [appengine-java] Re: Persistence with JPA + GAE

2010-02-09 Thread Johan Vallejo
Hi Diego Yes, i try using Long and Key but with both i have the error Log : javax.persistence.PersistenceException: Transaction is still active. You should always close your transactions correctly using commit() or rollback(). El 09/02/2010 01:06 p.m., Diego Osse Fernandes escribi: Hi

[appengine-java] Re: Persistence with JPA + GAE

2010-02-08 Thread Jake
Hello, The Google Datastore has four ways that you can store a Primary Key ID: String, Long, and two variations on Google's own Key object. If you want to create a parent/child relationship between two persisted objects (in your case, evento is the parent and distritos is the child), then you

Re: [appengine-java] Re: Persistence with JPA + GAE

2010-02-08 Thread Johan Vallejo
hi jake, thank for you answer i will try you suggestion and i will tell later El 08/02/2010 03:37 p.m., Jake escribió: Hello, The Google Datastore has four ways that you can store a Primary Key ID: String, Long, and two variations on Google's own Key object. If you want to create a