openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Veronezi <thi...@veronezi.org>
Subject Re: need help !!! Embended OpenEjb3.1.x
Date Tue, 01 Mar 2011 00:30:54 GMT
Ooops... sorry... I've missed that part. :O)
I've changed the testing-transaction example a little bit. Now it has a
BaseDAO just like your implementation (I think), and it seems to be working
fine. Could you try to reproduce this error by changing this code here?...

http://people.apache.org/~tveronezi/testing-transactions.zip

... and send it back to us?
Tkx,
Thiago.




On Mon, Feb 28, 2011 at 4:38 PM, kangkang <xinhua.gu@gmail.com> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message