thanks. It's working but i have another problem :(
working code :

  | @TransactionManagement(TransactionManagementType.BEAN)
  | @Remote(Fasade.class)
  | public @Stateless class FasadeBean implements Fasade 
  | {   
  |     @PersistenceContext(unitName = "TEST")
  |     private EntityManager oracleManager;
  |     @Resource public UserTransaction utx;
  |     
  |     @TransactionAttribute(TransactionAttributeType.REQUIRED)
  |     public void addTest(Test t) throws IllegalStateException, 
SecurityException, SystemException
  |     {       
  |             try {
  |                     System.out.println("============== Income 
=============");
  |                     utx.begin();
  |                     System.out.println("EntityManager = "+oracleManager);
  |                     System.out.println("UserTransaction = "+utx);
  |                     
  |                     System.out.println("Test = "+t);
  |                     oracleManager.persist(t);
  |                     
  |                     utx.commit();
  |                     System.out.println(" =============== Persisted 
=======");                               
  |             } catch (Exception e) {
  |                     utx.rollback();
  |                     e.printStackTrace();
  |             }
  |     }
  | 
  | 


and then i did some changes on this :
remove commit from this method and create new methot :


  |     public void commit() throws IllegalStateException, SecurityException, 
SystemException
  |     {
  |             try {
  |                     utx.commit();
  |                     System.out.println(" =============== Commited =======");
  |             } catch (Exception e) {
  |                     utx.rollback();
  |                     e.printStackTrace();
  |             }
  |     }
  | 


i want that one method begis transactions and another finish it.
but i get an error :


  | javax.ejb.EJBException: Application error: BMT stateless bean FasadeBean 
should complete transactions before returning (ejb1.1 spec, 11.6.1)
  |     at 
org.jboss.ejb3.tx.BMTInterceptor.checkStatelessDone(BMTInterceptor.java:184)
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963711
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to