This content has been marked as final.
Show 3 replies
-
1. Re: TransactionRequiredException
norman.richards Jan 3, 2007 9:19 AM (in response to vk101)You don't ever have a transaction context that spans multiple requests. Those would be separate transactions.
Can you show the code where you get the error? -
2. Re: TransactionRequiredException
vk101 Jan 3, 2007 9:53 AM (in response to vk101)Below is the first class where somebody simply logs in with the login() method.
@Stateless @Name("login") public class LoginBean implements Login { @PersistenceContext(type=TRANSACTION) private EntityManager em; @Out(required=false) private Member member; public String login() { member = new MemberGetter(em).getMember(loginName); if (member.getPassword().equals(getPassword())) { return "good"; } else { return null; } ... }
Once they are logged in, let's say they need to add a new name. The problem is that when you add a new name I don't think Member gets injected into the stateful bean from the outjected stateless login() method...
Does it have anything to do with the transaction attributes, persistence context types, or the fact that I'm going from stateless to stateful calls in one conversation?@Stateful @Name("change") public class ChangeBean implements Change { @PersistenceContext(type=EXTENDED) private EntityManager em; @In(create=true) @Out(required=false) private Member member; public String addName() { if (!new ChangeName(em).nameExists(name)) { member.getNames().add(name); return "good"; } else { return null; } ... }
-
3. Re: TransactionRequiredException
vk101 Jan 3, 2007 10:17 AM (in response to vk101)I'm not sure if this might have anything to do with it, but in my log I see a lot of "not founds":
08:13:49,781 DEBUG [Component] seam component not found: org.jboss 08:13:49,781 DEBUG [Component] seam component not found: org.jboss.seam 08:13:49,781 DEBUG [Component] seam component not found: org.jboss.seam.core
However, these also appear on other pages which work completely correctly, as well as this one which isn't working.
What is the meaning of these messages? Are they to be ignored (after all, their log level is only DEBUG...)