[jboss-user] [EJB 3.0] - javax.resource.ResourceException: Transaction is not active

trashhash do-not-reply at jboss.com
Wed Jan 24 18:30:44 EST 2007


Hi Im getting 

javax.resource.ResourceException: Transaction is not active

when this code executes. (em = EntityManager)


  | public getUserGoupById(Long id) {
  | 	Query dbQuery = em.createQuery("from UserGroup where id = :id");
  | 	dbQuery.setParameter("id", id);	
  |         UserGroup ug = (UserGroup) dbQuery.getSingleResult();
  |         return ug //Here the exception will be thrown.
  | }
  | 

In debugmode Im able to see that ug is what Im looking for (right Id & name). But every time I trie to return it the exception will show. I use the same bean for getUserById(Long id), and it works fine. What could be wrong in the usergroup-case?

Thanks!



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

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



More information about the jboss-user mailing list