openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kangkang <xinhua...@gmail.com>
Subject Re: need help !!! Embended OpenEjb3.1.x
Date Mon, 28 Feb 2011 20:38:30 GMT
thank you for thr reply, 

just like TransactionTest example does, i put a transactionBean in testcase
class and my test like followed:

    public void testWithTransaction() throws Exception {
        Caller transactionBean = (Caller)
context.lookup("TransactionBeanLocal");

        transactionBean.call(new Callable(){
            public Object call() throws Exception {
                userdao.createUser(newUser);
                return null;
            }
        });
    }

It doesnot help. no tx.

the Dao Bean class is an EJB with TransactionAttributeType "required", its
CMT:

Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class UserDAOBean extends GenericDAO<User, Long> implements UserDAO {
....
public User createUser(User user){
         return merge(user);


We got the UserDaO from OpenEJB and test its createUser function, stil the
same excpetion : 

DEBUG - The following method doesn't have a transaction policy assigned:
public abstract java.lang.Object
xx.xxx.persistence.dao.GenericDAO.merge(java.lang.Object)
DEBUG - finished invoking method merge. Return
value:xx.xxxx.persistence.entities.User@fa0bf9b7
DEBUG - finished invoking method call. Return value:null
FAILED: testCreateUser
java.lang.IllegalStateException: No tx on thread 


We did not call CRUD directly: But it seems that OpenEjb Container cannot
recognize the transaction policy for the inherent CRUD functions of class
GenericDAO

-- 
View this message in context: http://openejb.979440.n4.nabble.com/need-help-Embended-OpenEjb3-1-x-tp3328540p3328683.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message