entitymanager

How to implement generics using JPA/hibernate EntityManager and EJB3.0 ?

I have an slsb holding my business logic, how do I use generics to change the following three methods into one generic method ? The first two are the same db, the third is a different database. Also do the methods require further annotation in relation to transaction ? @PersistenceContext(unitName = "db") private EntityManager myEntity...

Hibernate v3.6 : Issue with the EntityManager method "refresh"

Hello, The following code throws an exception when invoking "em.refresh(p)": 1: EntityManager em = emf.createEntityManager(); 2: em.getTransaction().begin(); 3: 4: Product p = new Product("J&D", 35.0,"Whisky"); 5: em.persist(p); 6: 7: em.refresh(p); 8: em.getTransaction().commit(); 9: em.close(); When debugging the code, we see that ...

how to set limitation in EntityManager (JPA) L1 or L2 cache size

hi How to set L1 or L2 cache size-limitation. I concern of increasing the cache-size. One way is defining timeout for cache but i want to know is it possible to make a constraint for cache size or not? RGDS Navid ...