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();
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 =
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
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
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
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
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