hi,
we’re trying out the new vaadin version with jpacontainer and cdi-plugin ( Vaadin 7.0.0.beta8, JPA-Container 3.0.0-alpha1 )
We use JBoss configured with eclipselink… and we’ve followed the instructions in mattis blog:
Mattis Blog ( Using JPA Container in JEE6 Server )
it’s a little sample project with contacts-table and contacts editor. if i try to save in the editor i get TransactionRequiredException.
do i have to change the EjbEntityProvider? my EjbEntityProvider looks like this:
package de.zad.entityprovider;
import javax.annotation.PostConstruct;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.vaadin.addon.jpacontainer.provider.CachingMutableLocalEntityProvider;
/**
*
* @author heisecke
*
*/
@TransactionManagement
public abstract class EjbEntityProvider<T> extends CachingMutableLocalEntityProvider<T> {
@PersistenceContext(name="persistence/em",unitName="Heisecke")
protected EntityManager em;
protected EjbEntityProvider(Class entityClass) {
super(entityClass);
}
@PostConstruct
public void init() {
setTransactionsHandledByProvider(false);
setEntityManager(em);
setEntitiesDetached(false);
}
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
protected void runInTransaction(Runnable operation) {
super.runInTransaction(operation);
}
}
let me know, if you need further information!
thank you