[EMAIL PROTECTED]

did u mean "JBoss Transactions API" named ArjunaTA ?


i removed this code from my program 

  | manager.getTransaction().begin();   
  | manager.getTransaction().commit();
  | manager.getTransaction().rollback();
  | 
but i get en error again :(
error 

  | javax.persistence.TransactionRequiredException: EntityManager must be 
access within a transaction
  | 23:19:47,281 ERROR [STDERR]         at 
org.jboss.ejb3.entity.ManagedEntityManagerFactory.verifyInTx(ManagedEntityManagerFactory.java:149)
  | 23:19:47,281 ERROR [STDERR]         at 
org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:174)
  | 

my bean looks like :



  | import [...]
  | @TransactionManagement(value = TransactionManagementType.BEAN)
  | @Remote(StudentFasade.class)
  | public @Stateless
  | class StudentFasadeBean implements StudentFasade {
  | 
  |     @PersistenceContext
  |     private EntityManager manager;
  |     
  |     @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  |     public Long addStudent(Student stbean)
  |                     throws MagtiException {          
  |             try {
  |                     System.out.println("================= Adding Student 
=====================");                   
  |                     manager.persist(stbean);
  |                     return _student.getId();
  | 
  |             } catch (Exception e) {
  |                     e.printStackTrace();
  |                     return 0L;
  |             }
  |     }
  | }
  | 
  | 
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956517#3956517

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956517


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to