-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem testing CMT-DAOs
PostPosted: Tue May 02, 2006 9:08 am 
Newbie

Joined: Fri Apr 28, 2006 11:12 am
Posts: 2
Hello,

i am working on a Projekt using EJB 2.1 and Hibernate. I got lots of DAO using CMT together with SessionFactory.getCurrentSession()

But when i want to run my JUNIT Test Cases for the DAOs, i got an exception:

Code:
org.hibernate.HibernateException: createQuery is not valid without active transaction


To solve the Problem, i can change the code in the daos by using
Code:
session.beginTransaction
but i dont like to have this in my daos cause i want to use CMT.

Another way is to write a 2nd dao only for JUNIT..... also bad.

So any idea how to run JUNIT-Tests of CMT-DAOs without changing code?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.